diff --git a/.github/workflows/release-validator.yml b/.github/workflows/release-validator.yml index d27614e8..97782079 100644 --- a/.github/workflows/release-validator.yml +++ b/.github/workflows/release-validator.yml @@ -32,15 +32,24 @@ jobs: strategy: matrix: arch: [amd64, arm64, arm] + os: [windows, linux] + exclude: + - os: windows + arch: arm64 + - os: windows + arch: arm timeout-minutes: 10 runs-on: ubuntu-22.04 container: ghcr.io/linkerd/dev:v45-rust-musl steps: + - name: Install MinGW + if: matrix.os == 'windows' + run: apt-get update && apt-get install mingw-w64 -y - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - run: just validator arch=${{ matrix.arch }} profile=release version=${{ needs.meta.outputs.version }} package + - run: just validator arch=${{ matrix.arch }} os=${{ matrix.os }} profile=release version=${{ needs.meta.outputs.version }} package - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.arch }}-artifacts + name: ${{ matrix.arch }}-${{ matrix.os }}-artifacts path: target/package/ publish: diff --git a/justfile-rust b/justfile-rust index 182c0f1e..b282e3c6 100644 --- a/justfile-rust +++ b/justfile-rust @@ -16,25 +16,30 @@ profile := 'debug' # The architecture name to use for packages. Either 'amd64', 'arm64', or 'arm'. arch := env_var_or_default("TARGETARCH", "amd64") +# The OS name to use for packages. Either 'linux' or 'windows'. +os := "linux" + # If an `_arch` is specified, then we change the default cargo `--target` to # support cross-compilation. Otherwise, we use `rustup` to find the default. -_cargo-target := if arch == "amd64" { +_cargo-target := if os + '-' + arch == "linux-amd64" { "x86_64-unknown-linux-musl" - } else if arch == "arm64" { + } else if os + '-' + arch == "linux-arm64" { "aarch64-unknown-linux-musl" - } else if arch == "arm" { + } else if os + '-' + arch == "linux-arm" { "armv7-unknown-linux-musleabihf" + } else if os + '-' + arch == "windows-amd64" { + "x86_64-pc-windows-gnu" } else { - `rustup show | sed -n 's/^Default host: \(.*\)/\1/p'` + error("unsupported: os=" + os + " arch=" + arch) } _target-dir := "target" / _cargo-target / profile -_target-bin := _target-dir / crate +_target-bin := _target-dir / crate + if os == 'windows' { '.exe' } else { '' } -_package-name := crate + "-" + version + "-" + arch +_package-name := crate + "-" + version + "-" + arch + "-" + os _package-tgz := "target/package" / _package-name + ".tgz" _package-dir := "target/package" / _package-name -_package-bin := _package-dir / crate +_package-bin := _package-dir / crate + if os == 'windows' { '.exe' } else { '' } _package-dbg := _package-bin + ".dbg" _cargo := 'just-cargo profile=' + profile + ' target=' + _cargo-target @@ -52,4 +57,4 @@ package: build build *flags: {{ _cargo }} fetch --locked - {{ _cargo }} build --workspace -p {{ crate }} {{ flags }} + {{ _cargo }} build {{ if crate == "" { "--workspace" } else { "-p " + crate } }} {{ flags }}