Skip to content

Commit

Permalink
ci(macOS): Add zip release (#157)
Browse files Browse the repository at this point in the history
* ci(macOS): remove SHA env and build a zip

* ci(macOS): release dot zip

---------

Signed-off-by: XMLHexagram <[email protected]>
  • Loading branch information
XMLHexagram authored Dec 3, 2024
1 parent 8345391 commit 98863a2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand All @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set dotenv-load

lint:
cargo fmt -- --check
cargo clippy -- -D warnings
Expand Down
4 changes: 4 additions & 0 deletions scripts/macos_5_codesign_and_notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 7 additions & 2 deletions scripts/macos_6_create_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 98863a2

Please sign in to comment.