-
Notifications
You must be signed in to change notification settings - Fork 169
95 lines (78 loc) · 3.74 KB
/
testflight-prod.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Distribute TestFlight Production Build
on:
workflow_dispatch:
jobs:
distribute_testflight:
if: contains('["krodak","prybalko"]', github.actor)
runs-on: macos-13
name: Distribute TestFlight Production Build
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/[email protected]
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Setup - Xcode
run: sudo xcode-select -switch '/Applications/Xcode_15.0.app/Contents/Developer' && /usr/bin/xcodebuild -version
- name: Install dependencies
run: |
brew install swiftgen
brew install sourcery
- name: Get cached Swift Packages managed by Xcode
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Install Rust targets
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-ios,aarch64-apple-ios
components: rust-std
- name: Install uniffi_bindgen
uses: actions-rs/[email protected]
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target
- name: Install the Apple certificate and provisioning profile
env:
IOS_CERT_BASE64: ${{ secrets.IOS_CERT_BASE64 }}
IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$IOS_CERT_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$IOS_CERT_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
echo "KEYCHAIN_PATH_ENV=$(echo $KEYCHAIN_PATH)" >> $GITHUB_ENV
- name: Distribute TestFlight build
env:
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_BASE64: ${{ secrets.ASC_KEY_BASE64 }}
BUILD_NUMBER: $GITHUB_RUN_ID
KEYCHAIN_PATH: ${{ env.KEYCHAIN_PATH_ENV }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
cd ios
bundle exec fastlane distribute_production_testflight