From bac1f64da73863ee0df6bbb9924f716fab7cc0de Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:13:06 -0600 Subject: [PATCH 1/5] add macOS-apple-silicon release --- .github/workflows/release.yaml | 53 ++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6048504..6ef97f6 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: @@ -178,7 +178,7 @@ jobs: uses: actions/upload-artifact@v3 with: path: ${{ env.binary }}.dmg - name: mac + name: macOS-intel - name: Upload binaries to release if: ${{ env.add_binaries_to_github_release == 'true' }} @@ -186,7 +186,49 @@ 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 + + release-macOS-apple-silicon: + runs-on: macOS-latest + + steps: + - uses: olegtarasov/get-tag@v2.1.2 + id: get_version + - uses: actions/checkout@v3 + - 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/x86_64-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 }}.dmg + asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg tag: ${{ github.ref }} overwrite: true @@ -210,7 +252,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: From c1ed3cbed115cbff679538ac36a10e3e47e698d2 Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:17:27 -0600 Subject: [PATCH 2/5] fix target --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6ef97f6..c5a473e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -212,7 +212,7 @@ jobs: - name: Prepare Package run: | mkdir -p ${{ env.binary }}.app/Contents/MacOS - cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ 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 From 591d1c28be507faee44caf327071476bef7f9ee4 Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:47:19 -0600 Subject: [PATCH 3/5] add build comment --- .github/workflows/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c5a473e..f8593f5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -147,7 +147,7 @@ jobs: tag: ${{ github.ref }} overwrite: true - # Build for macOS-x86_64 + # Build for MacOS x86_64 release-macOS-intel: runs-on: macOS-latest @@ -190,6 +190,7 @@ jobs: tag: ${{ github.ref }} overwrite: true + # Build for MacOS Apple Silicon release-macOS-apple-silicon: runs-on: macOS-latest From d0f8bbd8e34faeab4c9f7732daf1a68101038aca Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:49:01 -0600 Subject: [PATCH 4/5] actions/checkout v4 --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f8593f5..2bca8a5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -197,7 +197,7 @@ jobs: steps: - uses: olegtarasov/get-tag@v2.1.2 id: get_version - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: targets: aarch64-apple-darwin From 71b2b61d7a6a1cd1caf90d906fa66c82f560f49b Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Sat, 16 Sep 2023 01:53:57 -0600 Subject: [PATCH 5/5] differentiate apple and intel executables --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2bca8a5..28095fa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -177,7 +177,7 @@ jobs: - name: Upload binaries to artifacts uses: actions/upload-artifact@v3 with: - path: ${{ env.binary }}.dmg + path: ${{ env.binary }}-intel.dmg name: macOS-intel - name: Upload binaries to release @@ -228,7 +228,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.binary }}.dmg + file: ${{ env.binary }}-apple-silicon.dmg asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg tag: ${{ github.ref }} overwrite: true