better tape #243
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MacOS | |
on: push | |
jobs: | |
build-and-release: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.4' | |
- name: Find and Replace OpenAIP | |
uses: richardrigutins/replace-in-files@v2 | |
with: | |
files: '**/*.dart' | |
search-text: '@@___openaip_client_id__@@' | |
replacement-text: ${{ secrets.OPENAIP_CLIENT_ID }} | |
encoding: 'utf8' | |
max-parallelism: 10 | |
- name: Install project dependencies | |
run: | | |
flutter pub get | |
brew install create-dmg | |
- name: Build artifacts and sign | |
run: | | |
flutter build macos --release | |
echo -n ${{ secrets.MACOS_DIST_CERTIFICATE }} | base64 --decode --output certificate.p12 | |
# create temporary keychain | |
security create-keychain -p test_password sign.keychain | |
security default-keychain -s sign.keychain | |
security unlock-keychain -p test_password sign.keychain | |
security import certificate.p12 -k sign.keychain -P ${{ secrets.MACOS_DIST_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k test_password sign.keychain | |
security find-identity | |
# sign | |
/usr/bin/codesign --force --deep -s LPHGYCR8ZX build/macos/Build/Products/Release/AvareX.app | |
# make dmg | |
pushd build/macos/Build/Products/Release | |
create-dmg \ | |
--volname "AvareX" \ | |
--window-pos 200 200 \ | |
--window-size 800 600 \ | |
--icon-size 130 \ | |
--text-size 14 \ | |
--icon "AvareX.app" 260 250 \ | |
--hide-extension "AvareX.app" \ | |
--app-drop-link 540 250 \ | |
--hdiutil-quiet \ | |
"AvareX.dmg" \ | |
"AvareX.app" | |
popd | |
# sign dmg | |
/usr/bin/codesign --force --deep -s LPHGYCR8ZX build/macos/Build/Products/Release/AvareX.dmg | |
# delete keychain | |
security delete-keychain sign.keychain | |
rm certificate.p12 | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MacOS | |
path: build/macos/Build/Products/Release/AvareX.dmg |