-
Notifications
You must be signed in to change notification settings - Fork 43
130 lines (103 loc) · 4.49 KB
/
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
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
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
paths:
- Configs/Deployment.xcconfig
jobs:
upload:
runs-on: macos-15
environment: Release
env:
GH_TOKEN: ${{ github.token }}
XCODEBUILD_EXTRA_ARGS: >
-allowProvisioningUpdates
-authenticationKeyPath /tmp/AuthKey.p8
-authenticationKeyID ${{ secrets.AUTHENTICATION_KEY_ID }}
-authenticationKeyIssuerID ${{ secrets.AUTHENTICATION_KEY_ISSUER_ID }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sanity check
run: |
set -x
version="$(cat Configs/Deployment.xcconfig | grep CURRENT_PROJECT_VERSION | awk '{ print $3 }')"
marketing_version="$(cat Configs/Deployment.xcconfig | grep MARKETING_VERSION | awk '{ print $3 }')"
# Grab all the tags
git fetch --tags
# Make sure this version doesn't exist already
! git tag --list | grep -q "v$version"
# Check that the commit message matches the version
git log -1 --pretty=%B | grep "\($version\)"
git log -1 --pretty=%B | grep "\($marketing_version\)"
- name: Create App Store Connect Key file
run: echo "${{ secrets.APP_STORE_CONNECT_KEY }}" | base64 -d > /tmp/AuthKey.p8
- name: Set up signing
run: |
KEYCHAIN="$RUNNER_TEMP/keychain.keychain-db"
KEYCHAIN_PASSWORD=password
echo "${{ secrets.CERTIFICATE }}" | base64 -d > "$RUNNER_TEMP/Certificate.p12"
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN"
security set-keychain-settings "$KEYCHAIN"
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN"
security list-keychains -d user -s "$KEYCHAIN"
security import "$RUNNER_TEMP/Certificate.p12" -P "${{ secrets.CERTIFICATE_PASSWORD }}" -A -k "$KEYCHAIN"
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp Release/iOS.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_16.1.app
- name: Disable macro validation
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- name: System Info
run: |
uname -a
xcodebuild -version
- name: Archive macOS
run: xcodebuild -scheme macOS -archivePath macOS.xcarchive archive
- name: Archive visionOS
run: xcodebuild -scheme visionOS -archivePath visionOS.xcarchive archive
- name: Collect Assets
run: |
(
cd macOS.xcarchive/Products/Applications/
zip -r macOS.zip Ensemble.app
mv macOS.zip ../../..
)
(
cd macOS.xcarchive/dSYMs/
zip -r macOS-symbols.zip Ensemble.app.dSYM/
mv macOS-symbols.zip ../..
)
(
cd visionOS.xcarchive/Products/Applications/
zip -r visionOS.zip Ensemble.app
mv visionOS.zip ../../..
)
(
cd visionOS.xcarchive/dSYMs/
zip -r visionOS-symbols.zip Ensemble.app.dSYM/
mv visionOS-symbols.zip ../..
)
- name: Create Release
run: |
version="$(cat Configs/Deployment.xcconfig | grep CURRENT_PROJECT_VERSION | awk '{ print $3 }')"
gh release create "v$version" -t "Build $version" -p macOS.zip macOS-symbols.zip visionOS.zip visionOS-symbols.zip
- name: Upload macOS
run: xcodebuild $XCODEBUILD_EXTRA_ARGS -exportArchive -exportOptionsPlist Release/ExportOptions.plist -archivePath macOS.xcarchive/ -exportPath macOS
- name: Upload visionOS
run: xcodebuild $XCODEBUILD_EXTRA_ARGS -exportArchive -exportOptionsPlist Release/ExportOptions.plist -archivePath visionOS.xcarchive/ -exportPath visionOS
- name: Send to TestFlight
env:
AUTHENTICATION_KEY: /tmp/AuthKey.p8
AUTHENTICATION_KEY_ID: ${{ secrets.AUTHENTICATION_KEY_ID }}
AUTHENTICATION_KEY_ISSUER_ID: ${{ secrets.AUTHENTICATION_KEY_ISSUER_ID }}
run: |
version="$(cat Configs/Deployment.xcconfig | grep CURRENT_PROJECT_VERSION | awk '{ print $3 }')"
# Make sure we all have all the latest tags (for notes)
git fetch --tags
Release/send_to_testflight.swift "$version"