From 0aecf8d0ed42704e791c9fb38abd87a40f7a5672 Mon Sep 17 00:00:00 2001 From: Chance Date: Mon, 21 Apr 2025 20:44:26 -0400 Subject: [PATCH] feat(ci): universal MacOS build support --- .forgejo/workflows/build-release.yml | 33 +++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index c632dac..6bf9907 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -3,7 +3,7 @@ name: Build Zenyx โšก on: push: pull_request: - + types: [opened, synchronize, reopened] jobs: setup: name: ๐Ÿ”ง Setup Environment @@ -44,14 +44,17 @@ jobs: cargo-test: name: ๐Ÿงช Run Cargo Tests - needs: [setup] + needs: setup runs-on: ubuntu-latest steps: - name: ๐Ÿ“ฅ Checkout source uses: https://github.com/actions/checkout@v4 + with: + lfs: true - name: ๐Ÿ—„๏ธ Restore Cargo cache uses: https://github.com/actions/cache@v4 + id: restore-cargo-cache with: path: | ~/.cargo/registry @@ -62,7 +65,6 @@ jobs: cargo- - name: ๐Ÿฆ€ Install Rust toolchain - if: steps.restore-cargo-cache.outputs.cache-hit != 'true' uses: https://github.com/actions-rs/toolchain@v1 with: toolchain: stable @@ -76,7 +78,7 @@ jobs: - name: ๐Ÿš€ Run tests - uses: https://github.com/actions-rs/cargo@v1 + uses: https://github.com/actions-rs/cargo@v1 with: command: test args: --release --all @@ -92,6 +94,8 @@ jobs: - x86_64-unknown-linux-gnu - aarch64-unknown-linux-gnu - x86_64-pc-windows-msvc + - aarch64-pc-windows-msvc + - universal2-apple-darwin include: - target: x86_64-unknown-linux-gnu binary_name: zenyx-x86_64-linux @@ -104,10 +108,20 @@ jobs: command: zigbuild args: --target aarch64-unknown-linux-gnu --release - target: x86_64-pc-windows-msvc - binary_name: zenyx-x86_64-windows-msvc + binary_name: zenyx-x86_64-windows ext: ".exe" command: xwin args: build --target x86_64-pc-windows-msvc --release + - target: aarch64-pc-windows-msvc + binary_name: zenyx-aarch64-windows + ext: ".exe" + command: xwin + args: build --target aarch64-pc-windows-msvc --release + - target: universal2-apple-darwin + binary_name: zenyx-universal-macos + ext: "" + command: zigbuild + args: --target universal2-apple-darwin --release steps: - name: ๐Ÿ“ฅ Checkout source @@ -115,6 +129,7 @@ jobs: - name: ๐Ÿ—„๏ธ Restore tool cache uses: https://github.com/actions/cache@v4 + id: restore-tools-cache with: path: | ~/.cargo/bin @@ -136,6 +151,7 @@ jobs: - name: ๐Ÿ—„๏ธ Restore Cargo cache uses: https://github.com/actions/cache@v4 + id: restore-cargo-cache with: path: | ~/.cargo/registry @@ -159,9 +175,10 @@ jobs: run: | mkdir -p artifacts cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }} - + - name: โฌ†๏ธ Upload artifact uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: - name: ${{ matrix.binary_name }}.zip - path: artifacts \ No newline at end of file + name: ${{ matrix.binary_name }}${{ matrix.ext }} + path: artifacts/${{ matrix.binary_name }}${{ matrix.ext }} + if-no-files-found: error \ No newline at end of file