From f51068337a92a7e8047d4ed36af2b3f81ec037d2 Mon Sep 17 00:00:00 2001 From: XMLHexagram Date: Mon, 2 Dec 2024 22:53:42 +0100 Subject: [PATCH 1/2] ci(macOS): remove SHA env and build a zip --- Justfile | 2 ++ scripts/macos_5_codesign_and_notarize.sh | 4 ++++ scripts/macos_6_create_dmg.sh | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Justfile b/Justfile index 5d24694b7..0a579222e 100644 --- a/Justfile +++ b/Justfile @@ -1,3 +1,5 @@ +set dotenv-load + macos-ci-all: macos-ci-clean macos-ci-install ./scripts/macos_2_build.sh ./scripts/macos_3_prepare_before_sign.sh diff --git a/scripts/macos_5_codesign_and_notarize.sh b/scripts/macos_5_codesign_and_notarize.sh index 6c10b5165..61314eebd 100755 --- a/scripts/macos_5_codesign_and_notarize.sh +++ b/scripts/macos_5_codesign_and_notarize.sh @@ -35,3 +35,7 @@ echo "Notarize: ----------------------------" xcrun notarytool submit "Rune.zip" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_PASSWORD" --wait xcrun stapler staple "Rune.app" + +rm -rf "Rune.zip" + +/usr/bin/ditto -c -k --keepParent --sequesterRsrc "Rune.app" "Rune.zip" \ No newline at end of file diff --git a/scripts/macos_6_create_dmg.sh b/scripts/macos_6_create_dmg.sh index 6e1a9cdb5..2419be44f 100755 --- a/scripts/macos_6_create_dmg.sh +++ b/scripts/macos_6_create_dmg.sh @@ -6,11 +6,16 @@ cd "$(dirname "$0")" cd .. cd temp_macos +# if $REF_NAME exists +if [ -n "$REF_NAME" ]; then + REF_NAME="-$REF_NAME" +fi + create-dmg \ - --volname "Rune-$REF_NAME-$SHA-macOS" \ + --volname "Rune$REF_NAME-macOS" \ --window-pos 200 120 \ --window-size 800 450 \ --icon-size 100 \ --app-drop-link 600 185 \ - "Rune-$REF_NAME-$SHA-macOS.dmg" \ + "Rune$REF_NAME-macOS.dmg" \ Rune.app \ No newline at end of file From e2b8c3a5c0dbd8a9bfc627c80c589130f9ab4d71 Mon Sep 17 00:00:00 2001 From: XMLHexagram Date: Tue, 3 Dec 2024 00:45:12 +0100 Subject: [PATCH 2/2] ci(macOS): release dot zip --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f5db855d..97ffe94f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -389,6 +389,12 @@ jobs: path: "temp_macos/*.dmg" name: Rune-${{ github.ref_name }}${{ github.event_name == 'workflow_dispatch' && format('-{0}', steps.short-sha.outputs.sha) || '' }}-macOS + - name: Upload artifact macOS ZIP + uses: actions/upload-artifact@v4 + with: + path: "temp_macos/*.zip" + name: Rune-${{ github.ref_name }}${{ github.event_name == 'workflow_dispatch' && format('-{0}', steps.short-sha.outputs.sha) || '' }}-macOS + - name: Clean up if: ${{ always() }} run: | @@ -404,7 +410,12 @@ jobs: run: | mv temp_macos/*.dmg "temp_macos/Rune-${{ github.ref_name }}-macOS.dmg" - - name: Release + - name: Rename ZIP + if: startsWith(github.ref, 'refs/tags/v') + run: | + mv temp_macos/*.zip "temp_macos/Rune-${{ github.ref_name }}-macOS.zip" + + - name: Release DMG uses: ncipollo/release-action@v1 if: startsWith(github.ref, 'refs/tags/v') with: @@ -414,6 +425,16 @@ jobs: omitBodyDuringUpdate: true makeLatest: true + - name: Release ZIP + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + artifacts: "temp_macos/Rune-${{ github.ref_name }}-macOS.zip" + allowUpdates: true + replacesArtifacts: false + omitBodyDuringUpdate: true + makeLatest: true + build-and-release-mac-app-store: runs-on: macos-latest if: startsWith(github.ref, 'refs/tags/v')