-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Publish on Mac App Store via GitHub Actions (#139)
* build(mac): App Store flavor. * ci: Mac App Store build & upload. * fix(macos,appstore): build version * Revert "build(mac): App Store flavor." This reverts commit 32e6f32. * build(mac, appstore): patch pbxproj instead of creating flutter flavor * ci(macos): Add provisioning profile * fix(mac): Include team id and bundle id in entitlements. * fix(macos, appstore): Build-time provisioning profile * build(macos): Encryption compliance declaration. * fix(macos): Sign the app properly.
- Loading branch information
Showing
9 changed files
with
271 additions
and
52 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
cd .. | ||
|
||
# Create backup of project.pbxproj | ||
cp macos/Runner.xcodeproj/project.pbxproj macos/Runner.xcodeproj/project.pbxproj.backup | ||
|
||
# Patch macos/Runner.xcodeproj/project.pbxproj and macos/Runner/Release.entitlements to replace bundle ID | ||
sed -i '' 's/PRODUCT_BUNDLE_IDENTIFIER = ci.not.rune;/PRODUCT_BUNDLE_IDENTIFIER = ci.not.rune.appstore;/g' macos/Runner.xcodeproj/project.pbxproj | ||
sed -i '' 's/<string>LG57TUQ726.ci.not.rune<\/string>/<string>LG57TUQ726.ci.not.rune.appstore<\/string>/g' macos/Runner/Release.entitlements | ||
|
||
flutter pub get | ||
rinf message | ||
cd macos | ||
pod update | ||
cd .. | ||
flutter build macos --build-number $RUNE_APPSTORE_BUILD_NUMBER --build-name $RUNE_APPSTORE_BUILD_VERSION --release | ||
chmod -R +x build/macos/Build/Products/Release/Rune.app | ||
xattr -cr build/macos/Build/Products/Release/Rune.app | ||
|
||
# Restore original project.pbxproj | ||
mv macos/Runner.xcodeproj/project.pbxproj.backup macos/Runner.xcodeproj/project.pbxproj |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
cd .. | ||
cd temp_macos | ||
|
||
echo "Codesign: ----------------------------" | ||
|
||
/usr/bin/codesign \ | ||
--deep \ | ||
--force \ | ||
-s "$APPLE_DISTRIBUTION_SIGNING_IDENTITY" \ | ||
--options runtime \ | ||
-v \ | ||
Rune.app | ||
|
||
/usr/bin/codesign \ | ||
--force \ | ||
-s "$APPLE_DISTRIBUTION_SIGNING_IDENTITY" \ | ||
--entitlements Release.entitlements \ | ||
--options runtime \ | ||
-v \ | ||
Rune.app | ||
|
||
echo "Package: ----------------------------" | ||
|
||
xcrun productbuild \ | ||
--sign "$MAC_DEVELOPER_INSTALLER_SIGNING_IDENTITY" \ | ||
--component Rune.app \ | ||
/Applications \ | ||
Rune.pkg | ||
|
||
echo "Upload to App Store Connect: ----------------------------" | ||
|
||
API_PRIVATE_KEYS_DIR=$RUNNER_TEMP \ | ||
xcrun altool \ | ||
--upload-package Rune.pkg \ | ||
--type osx \ | ||
--apiKey "$APP_STORE_CONNECT_KEYID" \ | ||
--apiIssuer "$APP_STORE_CONNECT_ISSUER" \ | ||
--asc-public-id "$APP_STORE_CONNECT_PUBLIC_ID" \ | ||
--apple-id "$APP_STORE_CONNECT_APP_APPLE_ID" \ | ||
--bundle-id "ci.not.rune.appstore" \ | ||
--bundle-short-version-string "$RUNE_APPSTORE_BUILD_VERSION" \ | ||
--bundle-version "$RUNE_APPSTORE_BUILD_NUMBER" \ | ||
--verbose |