Skip to content

Commit

Permalink
ci: sign manually
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Oct 21, 2024
1 parent c051c31 commit 98182e6
Showing 4 changed files with 108 additions and 55 deletions.
106 changes: 69 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -157,14 +157,39 @@ jobs:
name: App Bundle
path: build/app/outputs/bundle/release/app-release.aab

build-ios:
build-ipa:
runs-on: macos-latest

needs: get-flutter-version

env:
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
CERTIFICATE_PRIVATE_KEY: ${{ secrets.CERTIFICATE_PRIVATE_KEY }}

steps:
- uses: actions/checkout@v4

- name: Install codemagic-cli-tools
run: pip install codemagic-cli-tools

- name: Fetch signing files
run: >
app-store-connect fetch-signing-files com.poppingmoon.aria
--platform IOS
--type IOS_APP_STORE
--create
- name: Set up keychain
run: keychain initialize

- name: Add certificates
run: keychain add-certificates

- name: Update Xcode project settings
run: xcode-project use-profiles --export-options-plist ios/ExportOptions.plist

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
@@ -181,11 +206,43 @@ jobs:
build_name=$(grep version pubspec.yaml | sed 's/[^0-9]*\([0-9.]*\).*/\1/')
echo build-name=$build_name >> $GITHUB_OUTPUT
- name: Build for iOS
- name: Build IPA
run: >
flutter build ios
--no-codesign
flutter build ipa
--build-name ${{ steps.get-build-name.outputs.build-name }}
--export-options-plist ios/ExportOptions.plist
--verbose
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: IPA (signed)
path: build/ios/ipa/aria.ipa

- name: Publish IPA
if: startsWith(github.ref, 'refs/tags/')
run: app-store-connect publish --path build/ios/ipa/aria.ipa

build-ipa-unsigned:
runs-on: macos-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Get dependencies
run: flutter pub get

- name: Build for iOS
run: flutter build ios --no-codesign

- name: Copy Runner.app
run: |
@@ -208,33 +265,6 @@ jobs:
files: aria-${{ github.ref_name }}.ipa
draft: true

- name: Create xcarchive
if: startsWith(github.ref, 'refs/tags/')
working-directory: ios
run: >
xcodebuild archive
CODE_SIGNING_ALLOWED=NO
-workspace Runner.xcworkspace
-scheme Runner
-configuration Release
-archivePath Runner.xcarchive
- name: Dump AuthKey
if: startsWith(github.ref, 'refs/tags/')
run: echo "${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}" > AuthKey.p8

- name: Create IPA
if: startsWith(github.ref, 'refs/tags/')
run: >
xcodebuild
-exportArchive
-archivePath ios/Runner.xcarchive
-exportOptionsPlist ios/ExportOptions.plist
-allowProvisioningUpdates
-authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
-authenticationKeyID ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}
-authenticationKeyPath $(pwd)/AuthKey.p8
build-windows-x64:
runs-on: windows-latest

@@ -309,13 +339,11 @@ jobs:
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
CERTIFICATE_PRIVATE_KEY: ${{ secrets.CERTIFICATE_PRIVATE_KEY }}

steps:
- uses: actions/checkout@v4

- name: Dump cert_key
run: echo "${{ secrets.CERT_KEY }}" > cert_key

- name: Install codemagic-cli-tools
run: pip install codemagic-cli-tools

@@ -324,14 +352,12 @@ jobs:
app-store-connect fetch-signing-files com.poppingmoon.aria
--platform MAC_OS
--type MAC_APP_STORE
--certificate-key=@file:cert_key
--create
- name: Fetch certificates
run: >
app-store-connect certificates list
--type MAC_INSTALLER_DISTRIBUTION
--certificate-key=@file:cert_key
--save
- name: Set up keychain
@@ -353,8 +379,14 @@ jobs:
- name: Get dependencies
run: flutter pub get

- name: Get build name
id: get-build-name
run: |
build_name=$(grep version pubspec.yaml | sed 's/[^0-9]*\([0-9.]*\).*/\1/')
echo build-name=$build_name >> $GITHUB_OUTPUT
- name: Build for macOS
run: flutter build macos
run: flutter build macos --build-name ${{ steps.get-build-name.outputs.build-name }}

- name: Install create-dmg
run: brew install create-dmg
2 changes: 1 addition & 1 deletion ios/ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<key>manageAppVersionAndBuildNumber</key>
<true/>
<key>method</key>
<string>app-store</string>
<string>app-store-connect</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.5)
@@ -148,7 +148,7 @@ DEPENDENCIES:
- rust_lib_aria (from `.symlinks/plugins/rust_lib_aria/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
@@ -211,8 +211,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
sqflite_darwin:
:path: ".symlinks/plugins/sqflite_darwin/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
@@ -252,7 +252,7 @@ SPEC CHECKSUMS:
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
45 changes: 33 additions & 12 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -609,11 +609,13 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -623,6 +625,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.poppingmoon.aria;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = aria;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -800,11 +803,13 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -815,6 +820,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.poppingmoon.aria;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = aria;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -831,11 +837,13 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -846,6 +854,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.poppingmoon.aria;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = aria;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -864,10 +873,12 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
@@ -886,6 +897,8 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.poppingmoon.aria.Share-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "aria Share-Extension";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -907,10 +920,12 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
@@ -928,6 +943,8 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.poppingmoon.aria.Share-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "aria Share-Extension";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
@@ -947,10 +964,12 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CUSTOM_GROUP_ID = "group.com.poppingmoon.aria.Share-Extension";
DEVELOPMENT_TEAM = 7P4C63VUYA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7P4C63VUYA;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
@@ -968,6 +987,8 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.poppingmoon.aria.Share-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "aria Share-Extension";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;

0 comments on commit 98182e6

Please sign in to comment.