-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (67 loc) · 2.92 KB
/
ios-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: IOS release
on:
workflow_dispatch:
inputs:
build-name:
required: true
type: string
build-number:
required: true
type: string
workflow_call:
inputs:
build-name:
required: true
type: string
build-number:
required: true
type: string
concurrency:
group: ${{ github.workflow }}-ios-release-${{ github.head_ref }}
cancel-in-progress: true
# TODO https://damienaicheh.github.io/flutter/github/actions/2021/04/22/build-sign-flutter-ios-github-actions-en.html
jobs:
release-ios:
runs-on: macos-latest
timeout-minutes: 30
env:
APP_STORE_CONNECT_ISSUER_ID: "74f730c9-0d7e-4eff-b480-54f75e8945c8"
APP_STORE_CONNECT_KEY_IDENTIFIER: "W4B4G6CUU4"
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
CERTIFICATE_PRIVATE_KEY: ${{ secrets.APPLE_CERTIFICATE_PRIVATE_KEY }}
steps:
# Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
- name: Checkout repository
uses: actions/checkout@v4
- name: 🐍 Setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: 🪄 Install codemagic-cli-tools
run: pip3 install codemagic-cli-tools
# Install the Apple certificate and provisioning profile
- name: 🔑 Install the Apple certificate and provisioning profile
run: |
app-store-connect fetch-signing-files $(xcode-project detect-bundle-id) --platform IOS --type IOS_APP_STORE --create
xcode-project use-profiles --export-options-plist=$RUNNER_TEMP/export_options.plist --archive-method=app-store
keychain initialize -p $RUNNER_TEMP/build.keychain
keychain add-certificates -p $RUNNER_TEMP/build.keychain
curl -o $RUNNER_TEMP/AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
security import $RUNNER_TEMP/AppleWWDRCAG3.cer -k $RUNNER_TEMP/build.keychain -T /usr/bin/codesign
- name: 🧰 Setup app
uses: ./.github/actions/setup-app
# Build and sign the ipa using a single flutter command
- name: 🛠️ Building IPA
run: flutter build ipa --release --export-options-plist=$RUNNER_TEMP/export_options.plist --build-name=${{ inputs.build-name }} --build-number=${{ inputs.build-number }}
# Important! Cleanup: remove the certificate and provisioning profile from the runner!
- name: 🧹 Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
keychain delete -p $RUNNER_TEMP/build.keychain
security default-keychain -s login.keychain
- name: ⏫ Publishing app to TestFlight
env:
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
IPA_PATH: build/ios/ipa/now-u.ipa
run: ./.github/scripts/publish_testflight.sh