diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6048504..28095fa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -147,8 +147,8 @@ jobs: tag: ${{ github.ref }} overwrite: true - # Build for macOS - release-macos: + # Build for MacOS x86_64 + release-macOS-intel: runs-on: macOS-latest steps: @@ -177,8 +177,8 @@ jobs: - name: Upload binaries to artifacts uses: actions/upload-artifact@v3 with: - path: ${{ env.binary }}.dmg - name: mac + path: ${{ env.binary }}-intel.dmg + name: macOS-intel - name: Upload binaries to release if: ${{ env.add_binaries_to_github_release == 'true' }} @@ -186,7 +186,50 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ env.binary }}.dmg - asset_name: ${{ env.binary }}-macos-${{ steps.get_version.outputs.tag }}.dmg + asset_name: ${{ env.binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg + tag: ${{ github.ref }} + overwrite: true + + # Build for MacOS Apple Silicon + release-macOS-apple-silicon: + runs-on: macOS-latest + + steps: + - uses: olegtarasov/get-tag@v2.1.2 + id: get_version + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin + - name: Environment + # macOS 11 was the first version to support ARM + run: | + export MACOSX_DEPLOYMENT_TARGET="11" + + - name: Build + run: | + cargo build --release --target aarch64-apple-darwin + + - name: Prepare Package + run: | + mkdir -p ${{ env.binary }}.app/Contents/MacOS + cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/ + cp -r assets ${{ env.binary }}.app/Contents/MacOS/ + hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}.dmg + + - name: Upload binaries to artifacts + uses: actions/upload-artifact@v3 + with: + path: ${{ env.binary }}.dmg + name: macOS-apple-silicon + + - name: Upload binaries to release + if: ${{ env.add_binaries_to_github_release == 'true' }} + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.binary }}-apple-silicon.dmg + asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg tag: ${{ github.ref }} overwrite: true @@ -210,7 +253,8 @@ jobs: - release-wasm - release-linux - release-windows - - release-macos + - release-macOS-intel + - release-macOS-apple-silicon if: ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }} steps: