diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed3796d..de41389 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,6 +102,12 @@ jobs: fetch-depth: 0 - name: Install coreutils run: brew install coreutils + - name: Zig Setup + uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.12.1 + - name: Install cargo-zigbuild + run: cargo install cargo-zigbuild - name: Download SDK run: wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.15.sdk.tar.xz - name: Setup SDK env @@ -111,7 +117,7 @@ jobs: - name: Release x86 run: | rustup target add x86_64-apple-darwin - cargo build --release --target x86_64-apple-darwin + cargo zigbuild --release --target x86_64-apple-darwin yes | cp -rf target/x86_64-apple-darwin/release/grim macos/Grim.app/Contents/MacOS - name: Archive x86 run: | @@ -132,7 +138,7 @@ jobs: - name: Release ARM run: | rustup target add aarch64-apple-darwin - cargo build --release --target aarch64-apple-darwin + cargo zigbuild --release --target aarch64-apple-darwin yes | cp -rf target/aarch64-apple-darwin/release/grim macos/Grim.app/Contents/MacOS - name: Archive ARM run: | @@ -144,14 +150,10 @@ jobs: working-directory: target/aarch64-apple-darwin/release shell: bash run: sha256sum grim-${{ github.ref_name }}-macos-arm.zip > grim-${{ github.ref_name }}-macos-arm-sha256sum.txt - - name: Setup platform env - run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV - - name: Setup SDK env - run: echo "SDKROOT=${{ github.workspace }}/MacOSX10.15.sdk" >> $GITHUB_ENV - name: Release Universal run: | - lipo -create -output target/grim target/aarch64-apple-darwin/release/grim target/x86_64-apple-darwin/release/grim - yes | cp -rf target/grim macos/Grim.app/Contents/MacOS + cargo zigbuild --release --target universal2-apple-darwin + yes | cp -rf target/universal2-apple-darwin/release/grim macos/Grim.app/Contents/MacOS - name: Archive Universal run: | cd macos @@ -160,7 +162,7 @@ jobs: cd .. - name: Checksum Release Universal working-directory: target/universal2-apple-darwin/release - shell: bash + shell: pwsh run: sha256sum grim-${{ github.ref_name }}-macos-universal.zip > grim-${{ github.ref_name }}-macos-universal-sha256sum.txt - name: Release uses: softprops/action-gh-release@v1