Skip to content

Commit f3d8d5e

Browse files
committed
buld(validator): modify Ci job to release windows binaries
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
1 parent 90a0446 commit f3d8d5e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/release-validator.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
arch: [amd64, arm64, arm]
35+
os: [windoes, linux]
36+
exclude:
37+
- os: windows
38+
arch: arm64
39+
- os: windows
40+
arch: arm
3541
timeout-minutes: 10
3642
runs-on: ubuntu-22.04
3743
container: ghcr.io/linkerd/dev:v45-rust-musl
3844
steps:
45+
- name: Install MiniGW
46+
if: matrix.os == 'windows'
47+
run: apt-get update && apt-get install mingw-w64 -y
3948
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4049
- run: just validator arch=${{ matrix.arch }} profile=release version=${{ needs.meta.outputs.version }} package
4150
- uses: actions/upload-artifact@v4

justfile-rust

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ profile := 'debug'
1616
# The architecture name to use for packages. Either 'amd64', 'arm64', or 'arm'.
1717
arch := env_var_or_default("TARGETARCH", "amd64")
1818

19+
# The OS name to use for packages. Either 'linux' or 'windows'.
20+
os := "linux"
21+
1922
# If an `_arch` is specified, then we change the default cargo `--target` to
2023
# support cross-compilation. Otherwise, we use `rustup` to find the default.
21-
_cargo-target := if arch == "amd64" {
24+
_cargo-target := if os + '-' + arch == "linux-amd64" {
2225
"x86_64-unknown-linux-musl"
23-
} else if arch == "arm64" {
26+
} else if os + '-' + arch == "linux-arm64" {
2427
"aarch64-unknown-linux-musl"
25-
} else if arch == "arm" {
28+
} else if os + '-' + arch == "linux-arm" {
2629
"armv7-unknown-linux-musleabihf"
30+
} else if os + '-' + arch == "windows-amd64" {
31+
"x86_64-pc-windows-gnu"
2732
} else {
28-
`rustup show | sed -n 's/^Default host: \(.*\)/\1/p'`
33+
error("unsupported: os=" + os + " arch=" + arch)
2934
}
3035

3136
_target-dir := "target" / _cargo-target / profile
@@ -34,7 +39,7 @@ _target-bin := _target-dir / crate
3439
_package-name := crate + "-" + version + "-" + arch
3540
_package-tgz := "target/package" / _package-name + ".tgz"
3641
_package-dir := "target/package" / _package-name
37-
_package-bin := _package-dir / crate
42+
_package-bin := _package-dir / crate + if os == 'windows' { '.exe' } else { '' }
3843
_package-dbg := _package-bin + ".dbg"
3944

4045
_cargo := 'just-cargo profile=' + profile + ' target=' + _cargo-target

0 commit comments

Comments
 (0)