-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (77 loc) · 2.9 KB
/
ios.yaml
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
name: XMUX iOS Internal
on:
push:
branches:
- master
paths:
- .github/workflows/ios.yaml
- lib/**
- ios/**
- pubspec.yaml
- pubspec.lock
jobs:
Build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
with:
channel: beta
- name: Match
run: |
TEMP_KEYCHAIN_NAME="ci_$(uuidgen)"
TEMP_KEYCHAIN_PASSWORD="$(openssl rand -base64 32)"
security create-keychain -p "$TEMP_KEYCHAIN_PASSWORD" "$TEMP_KEYCHAIN_NAME.keychain"
security unlock-keychain -p "$TEMP_KEYCHAIN_PASSWORD" "$TEMP_KEYCHAIN_NAME.keychain"
security set-keychain-settings -t 3600 -u "$TEMP_KEYCHAIN_NAME.keychain"
security list-keychains -s "$TEMP_KEYCHAIN_NAME.keychain"
security default-keychain -s "$TEMP_KEYCHAIN_NAME.keychain"
gem install fastlane
export MATCH_KEYCHAIN_NAME="$TEMP_KEYCHAIN_NAME"
export MATCH_KEYCHAIN_PASSWORD="$TEMP_KEYCHAIN_PASSWORD"
fastlane match appstore --readonly
env:
FASTLANE_DONT_STORE_PASSWORD: "1"
MATCH_GIT_PRIVATE_KEY: ${{ secrets.DEPLOY_CERTS }}
MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_PASSWORD }}
- name: Build
run: |
FLUTTER_BUILD_NUMBER=$(git rev-list --count HEAD)
GIT_DESC=$(git describe --tags)
if [[ $GIT_DESC =~ v([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)-g[a-f0-9]+ ]]; then
FLUTTER_BUILD_NAME="${BASH_REMATCH[1]}.$((BASH_REMATCH[2]+1)).${BASH_REMATCH[3]}"
else
FLUTTER_BUILD_NAME="0.0.1"
fi
echo $CONFIG_ENV | base64 -d > .env
flutter build ipa \
--release \
--build-name=$FLUTTER_BUILD_NAME \
--build-number=$FLUTTER_BUILD_NUMBER \
--dart-define-from-file=.env \
--export-options-plist=ios/ExportOptions.plist
env:
CONFIG_ENV: ${{ secrets.CONFIG_ENV }}
- uses: actions/upload-artifact@v4
with:
name: XMUX-iOS
path: build/ios/ipa/XMUX.ipa
DeployAppStoreConnect:
runs-on: macos-latest
needs: Build
steps:
- uses: actions/download-artifact@v4
with:
name: XMUX-iOS
path: XMUX-iOS
- name: Upload to App Store Connect
run: |
mkdir ~/private_keys
echo $APP_STORE_CONNECT_KEY_FILE | base64 -d > ~/private_keys/AuthKey_$APP_STORE_CONNECT_KEY.p8
xcrun altool --upload-app --type ios -f XMUX-iOS/XMUX.ipa --apiKey $APP_STORE_CONNECT_KEY --apiIssuer $APP_STORE_CONNECT_KEY_ISSUER
env:
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
APP_STORE_CONNECT_KEY_FILE: ${{ secrets.APP_STORE_CONNECT_KEY_FILE }}
APP_STORE_CONNECT_KEY_ISSUER: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER }}