Skip to content

Commit

Permalink
Add Windows mingw-w64 cross-compile to CI/CD.
Browse files Browse the repository at this point in the history
Fix some help text in clap.yaml (incorrect frequency range examples).

Update README.md text.

Update cargo deps.
  • Loading branch information
defcronyke committed Jan 7, 2021
1 parent 2c82060 commit c7e0bba
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 32 deletions.
48 changes: 40 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ image: "rust:latest"
stages:
- test
- docs
- debug
- build
- debug-linux-x86_64
- debug-windows-x86_64
- build-linux-x86_64
- build-windows-x86_64

# Use cargo to test the project
test:
Expand Down Expand Up @@ -48,9 +50,9 @@ docs:
paths:
- target/doc

# Use cargo to build the debug project
debug:
stage: debug
# Use cargo to build the debug project for linux
debug-linux-x86_64:
stage: debug-linux-x86_64
needs: ["test"]
script:
- rustc --version && cargo --version # Print version info for debugging
Expand All @@ -60,9 +62,24 @@ debug:
paths:
- target/debug

# Use cargo to build the release project
build:
stage: build
# Use cargo to build the debug project for windows
debug-windows-x86_64:
stage: debug-windows-x86_64
needs: ["test"]
script:
- apt-get update && apt-get install -y mingw-w64
- rustup target add x86_64-pc-windows-gnu
- rustup toolchain install stable-x86_64-pc-windows-gnu
- rustc --version && cargo --version # Print version info for debugging
- cargo build --target x86_64-pc-windows-gnu --verbose
artifacts:
expire_in: never
paths:
- target/x86_64-pc-windows-gnu/debug

# Use cargo to build the release project for linux
build-linux-x86_64:
stage: build-linux-x86_64
needs: ["test"]
script:
- rustc --version && cargo --version # Print version info for debugging
Expand All @@ -71,3 +88,18 @@ build:
expire_in: never
paths:
- target/release

# Use cargo to build the release project for windows
build-windows-x86_64:
stage: build-windows-x86_64
needs: ["test"]
script:
- apt-get update && apt-get install -y mingw-w64
- rustup target add x86_64-pc-windows-gnu
- rustup toolchain install stable-x86_64-pc-windows-gnu
- rustc --version && cargo --version # Print version info for debugging
- cargo build --release --target x86_64-pc-windows-gnu --verbose
artifacts:
expire_in: never
paths:
- target/x86_64-pc-windows-gnu/release
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[package]
name = "signal-gen-cjds66"
version = "0.1.5"
version = "0.1.6"
authors = ["Jeremy Carter <[email protected]>"]
edition = "2018"

Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ to the LICENSE TERMS, you aren't allowed to use this
software.


Usage: `cargo run --release -- -h`
Usage (Linux): `./signal-gen-cjds66 -h`

Usage (Windows): `signal-gen-cjds66.exe -h`

Usage (when building from source): `cargo run --release -- -h`

[Full Usage Info (from the project Wiki)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/wikis/usage)

Expand Down Expand Up @@ -47,11 +51,17 @@ ID 1a86:7523 QinHeng Electronics CH340 serial converter

HOW TO INSTALL AND USE:
----------------------
You can download the latest Linux x86_64 numbered release build here:
[signal-gen-cjds66 Linux x86_64 binary (latest release build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/v0.1.5/download?job=build)
Download the latest Linux x86_64 binary release here:
[signal-gen-cjds66 Linux x86_64 binary (latest release build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/v0.1.6/download?job=build-linux-x86_64)

Download the latest Windows x86_64 binary release here:
[signal-gen-cjds66 Windows x86_64 binary (latest release build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/v0.1.6/download?job=build-windows-x86_64)

Download the latest Linux x86_64 binary development build here:
[signal-gen-cjds66 Linux x86_64 binary (latest development build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/master/download?job=build-linux-x86_64)

You can download the latest Linux x86_64 development build here:
[signal-gen-cjds66 Linux x86_64 binary (latest development build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/master/download?job=build)
Download the latest Windows x86_64 binary development build here:
[signal-gen-cjds66 Windows x86_64 binary (latest development build)](https://gitlab.com/defcronyke/signal-gen-cjds66/-/jobs/artifacts/master/download?job=build-windows-x86_64)

The development build passed all the automated tests, but it should
be considered somewhat experimental, since it's not a numbered release
Expand All @@ -62,11 +72,9 @@ of the program.
Binary releases for other platforms may be available at some point,
but this is written in the Rust programming language, which makes
it easy enough to compile the project from source yourself, and it's
recommended you do that anyway for less chance of problems. This
program is tested and working on Windows also, you just have to
compile it yourself for now.
recommended you do that anyway for less chance of problems.

Here's how to compile it yourself:
Here's how to compile and run it from source yourself:

1. Install the Rust programming language toolchain from:
[https://rustup.rs](https://rustup.rs)
Expand Down
18 changes: 9 additions & 9 deletions clap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: signal-gen-cjds66

author: Jeremy Carter <[email protected]>

version: "0.1.5"
version: "0.1.6"

about: |
An unofficial program to control the CJDS66 60MHz DDS
Expand Down Expand Up @@ -380,56 +380,56 @@ args:
long: freq-milli-ch1
takes_value: true
value_name: ch1_freq_mHz
help: "Set the waveform frequency for channel 1 in mHz (millihertz). The value must be a number 0.01-80000000.0. For example: -i 0.01"
help: "Set the waveform frequency for channel 1 in mHz (millihertz). The value must be a number 0.0-80000000.0. For example: -i 0.01"

- set_frequency_millihz_channel2:
short: j
long: freq-milli-ch2
takes_value: true
value_name: ch2_freq_mHz
help: "Set the waveform frequency for channel 2 in mHz (millihertz). The value must be a number 0.01-80000000.0. For example: -j 0.01"
help: "Set the waveform frequency for channel 2 in mHz (millihertz). The value must be a number 0.0-80000000.0. For example: -j 0.01"

- set_frequency_hz_channel1:
short: e
long: freq-hz-ch1
takes_value: true
value_name: ch1_freq_Hz
help: "Set the waveform frequency for channel 1 in Hz. The value must be a number 0.01-60000000.0. For example: -e 0.01"
help: "Set the waveform frequency for channel 1 in Hz. The value must be a number 0.0-60000000.0. For example: -e 0.01"

- set_frequency_hz_channel2:
short: f
long: freq-hz-ch2
takes_value: true
value_name: ch2_freq_Hz
help: "Set the waveform frequency for channel 2 in Hz. The value must be a number 0.01-60000000.0. For example: -f 0.01"
help: "Set the waveform frequency for channel 2 in Hz. The value must be a number 0.0-60000000.0. For example: -f 0.01"

- set_frequency_khz_channel1:
short: k
long: freq-khz-ch1
takes_value: true
value_name: ch1_freq_kHz
help: "Set the waveform frequency for channel 1 in kHz. The value must be a number 0.00001-60000.0. For example: -k 0.00001"
help: "Set the waveform frequency for channel 1 in kHz. The value must be a number 0.0-60000.0. For example: -k 0.00001"

- set_frequency_khz_channel2:
short: l
long: freq-khz-ch2
takes_value: true
value_name: ch2_freq_kHz
help: "Set the waveform frequency for channel 2 in kHz. The value must be a number 0.00001-60000.0. For example: -l 0.00001"
help: "Set the waveform frequency for channel 2 in kHz. The value must be a number 0.0-60000.0. For example: -l 0.00001"

- set_frequency_mega_channel1:
short: "y"
long: freq-mega-ch1
takes_value: true
value_name: ch1_freq_MHz
help: "Set the waveform frequency for channel 1 in MHz (megahertz). The value must be a number 0.00000001-60.0. For example: -y 0.00000001"
help: "Set the waveform frequency for channel 1 in MHz (megahertz). The value must be a number 0.0-60.0. For example: -y 0.00000001"

- set_frequency_mega_channel2:
short: z
long: freq-mega-ch2
takes_value: true
value_name: ch2_freq_MHz
help: "Set the waveform frequency for channel 2 in MHz (megahertz). The value must be a number 0.00000001-60.0. For example: -z 0.00000001"
help: "Set the waveform frequency for channel 2 in MHz (megahertz). The value must be a number 0.0-60.0. For example: -z 0.00000001"

- set_amplitude_volts_channel1:
short: p
Expand Down
2 changes: 1 addition & 1 deletion signal-gen-cjds66-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[package]
name = "signal-gen-cjds66-lib"
version = "0.1.5"
version = "0.1.6"
authors = ["Jeremy Carter <[email protected]>"]
edition = "2018"
description = "An unofficial support library which can fully remote control the inexpensive Koolertron DDS Signal Generator known as GH-CJDS66."
Expand Down

0 comments on commit c7e0bba

Please sign in to comment.