From c8411800e36565f65e37c03817f23bb5e39bf30e Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Thu, 18 Sep 2025 20:26:28 +1000 Subject: [PATCH 1/2] Build and compress release artifact for MacOS and Windows --- .github/workflows/release.yaml | 60 +++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef55579..548a755 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,14 @@ on: jobs: build: name: Build and Upload - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + - os: macos-latest + - os: windows-latest + steps: - name: Clone project uses: actions/checkout@v3 @@ -31,39 +38,68 @@ jobs: run: | cargo build --release - - name: Prepare binary + - name: Prepare target name id: prepare run: | case "${{ runner.os }}" in Linux) OS="linux" ;; - Windows) - OS="windows" - ;; macOS) - OS="macos" + OS="darwin" ;; - *) - OS="${{ runner.os }}" + Windows) + OS="windows" ;; esac case "${{ runner.arch }}" in + ARM) + ARCH="arm" + ;; + ARM64) + ARCH="aarch64" + ;; X64) ARCH="x86_64" ;; + X86) + ARCH="i686" + ;; *) ARCH="${{ runner.arch }}" ;; esac - TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz" - gzip -c target/release/technique > ${TARGET} - echo "binary=${TARGET}" >> $GITHUB_OUTPUT + case "${{ runner.os }}" in + Linux) + TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz" + ;; + macOS) + TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz" + ;; + Windows) + TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.zip" + ;; + esac + + echo "target=${TARGET}" >> $GITHUB_OUTPUT + + - name: Compress binary (Unix) + id: compress + if: runner.os != 'Windows' + run: | + gzip -c target/release/technique > ${{ steps.prepare.outputs.target }} + + - name: Compress binary (Windows) + id: compress + if: runner.os == 'Windows' + shell: pwsh + run: | + Compress-Archive -Path target/release/technique.exe -DestinationPath ${{ steps.prepare.outputs.target }} - name: Upload binary to Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.ref_name }} - files: ${{ steps.prepare.outputs.binary }} + files: ${{ steps.prepare.outputs.target }} From 5d640531cd1fa7a0dd7117f5ec843a26b16b6a58 Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Thu, 18 Sep 2025 20:28:12 +1000 Subject: [PATCH 2/2] Remove unnecessary identifier --- .github/workflows/release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 548a755..ae7be5c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -86,13 +86,11 @@ jobs: echo "target=${TARGET}" >> $GITHUB_OUTPUT - name: Compress binary (Unix) - id: compress if: runner.os != 'Windows' run: | gzip -c target/release/technique > ${{ steps.prepare.outputs.target }} - name: Compress binary (Windows) - id: compress if: runner.os == 'Windows' shell: pwsh run: |