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 345de9a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 55 deletions.
96 changes: 59 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,35 @@ 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
- name: Set up keychain
run: keychain initialize

- name: Add certificates
run: keychain add-certificates

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -181,11 +202,37 @@ 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: 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: |
Expand All @@ -208,33 +255,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

Expand Down Expand Up @@ -309,13 +329,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

Expand All @@ -324,14 +342,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
Expand All @@ -353,8 +369,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
Expand Down
2 changes: 1 addition & 1 deletion ios/ExportOptions.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
45 changes: 33 additions & 12 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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";
Expand Down Expand Up @@ -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 = (
Expand All @@ -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;
Expand All @@ -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 = (
Expand All @@ -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";
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 345de9a

Please sign in to comment.