-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (106 loc) · 4.33 KB
/
publishing.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Publishing
on:
push:
branches:
- develop
- hotfix/*
- release/*
tags:
- v*.*.*
jobs:
build:
name: Build
runs-on: macos-14
environment: apple-app-store
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Cache packages
uses: actions/cache@v4
with:
path: |
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Set up signing certificate
env:
CERTIFICATE_PRIVATE_KEY_B64: ${{ secrets.CERTIFICATE_PRIVATE_KEY_B64 }}
run: |
echo $CERTIFICATE_PRIVATE_KEY_B64 | base64 --decode > /tmp/cert-fyreplace.p12
security create-keychain -p password build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p password build.keychain
security set-keychain-settings build.keychain
security import /tmp/cert-fyreplace.p12 -k build.keychain -P '' -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k password build.keychain
- name: Set up App Store Connect authentication
env:
APP_STORE_CONNECT_PRIVATE_KEY_B64: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY_B64 }}
run: echo $APP_STORE_CONNECT_PRIVATE_KEY_B64 | base64 --decode > /tmp/connect-key.p8
- name: Prepare files
run: make
- name: Install dependencies
run: |
brew install protobuf swift-protobuf grpc-swift
- name: Build app
run: |
xcodebuild archive \
DEVELOPMENT_TEAM=${{ secrets.TEAM_ID }} \
PROVISIONING_PROFILE_SPECIFIER=${{ secrets.PROVISIONING_PROFILE_NAME }} \
-allowProvisioningUpdates \
-authenticationKeyPath /tmp/connect-key.p8 \
-authenticationKeyID ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }} \
-authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} \
-workspace Fyreplace.xcworkspace \
-scheme Fyreplace \
-archivePath archive.xcarchive
- name: Export to IPA
run: |
/usr/libexec/PlistBuddy -c "Add :method string" ExportOptions.plist
/usr/libexec/PlistBuddy -c "Set :method app-store" ExportOptions.plist
/usr/libexec/PlistBuddy -c "Add :teamId string" ExportOptions.plist
/usr/libexec/PlistBuddy -c "Set :teamId ${{ secrets.TEAM_ID }}" ExportOptions.plist
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles dict" ExportOptions.plist
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:${{ secrets.APP_ID }} string ${{ secrets.PROVISIONING_PROFILE_NAME }}" ExportOptions.plist
xcodebuild export \
-allowProvisioningUpdates \
-authenticationKeyPath /tmp/connect-key.p8 \
-authenticationKeyID ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }} \
-authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} \
-archivePath archive.xcarchive \
-exportArchive \
-exportOptionsPlist ExportOptions.plist \
-exportPath export
- uses: actions/upload-artifact@v4
with:
name: Fyreplace.ipa
path: export/*.ipa
if-no-files-found: error
publish:
name: Publish
needs: build
runs-on: macos-14
environment: apple-app-store
steps:
- uses: actions/download-artifact@v4
with:
name: Fyreplace.ipa
path: /tmp
- name: Set up App Store Connect authentication
env:
APP_STORE_CONNECT_PRIVATE_KEY_B64: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY_B64 }}
run: |
mkdir ~/private_keys
echo $APP_STORE_CONNECT_PRIVATE_KEY_B64 | base64 --decode > ~/private_keys/AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}.p8
- name: Upload IPA to App Store Connect
run: |
xcrun altool \
--upload-app \
--type ios \
--file /tmp/Fyreplace.ipa \
--apiKey ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }} \
--apiIssuer ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}