Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(macOS): Add zip release #157

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

macos-ci-all: macos-ci-clean macos-ci-install
./scripts/macos_2_build.sh
./scripts/macos_3_prepare_before_sign.sh
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