-
Notifications
You must be signed in to change notification settings - Fork 5
227 lines (196 loc) · 6.87 KB
/
Copy pathsundial-demo.yml
File metadata and controls
227 lines (196 loc) · 6.87 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Sundial Demo Apps
on:
push:
branches-ignore:
- '*WIP'
paths:
- 'Examples/Sundial/**'
- '.github/workflows/sundial-demo.yml'
workflow_dispatch:
inputs:
deploy_testflight:
description: 'Deploy to TestFlight'
required: false
type: boolean
default: false
# Uncomment to enable automatic TestFlight deployment on version tags
# push:
# tags:
# - 'demo-v*'
env:
DEMO_PATH: Examples/Sundial
jobs:
# Build and test Swift Package across platforms
build-demo:
name: Build Sundial Demo Package
runs-on: ${{ matrix.runs-on }}
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
strategy:
fail-fast: false
matrix:
include:
# iOS Build - Xcode 26.4 on macOS-26
- type: ios
runs-on: macos-26
xcode: "/Applications/Xcode_26.4.app"
deviceName: "iPhone 17 Pro"
osVersion: "26.4"
download-platform: true
# watchOS Build - Xcode 26.4 on macOS-26
- type: watchos
runs-on: macos-26
xcode: "/Applications/Xcode_26.4.app"
deviceName: "Apple Watch Ultra 3 (49mm)"
osVersion: "26.4"
download-platform: true
steps:
- uses: actions/checkout@v6
- name: Build and Test
uses: brightdigit/swift-build@v1
with:
scheme: Sundial-Package
type: ${{ matrix.type }}
xcode: ${{ matrix.xcode }}
deviceName: ${{ matrix.deviceName }}
osVersion: ${{ matrix.osVersion }}
download-platform: ${{ matrix.download-platform }}
working-directory: ${{ env.DEMO_PATH }}
# Lint demo app code
lint-demo:
name: Lint Sundial Demo
runs-on: ubuntu-latest
needs: [build-demo]
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
env:
LINT_MODE: STRICT
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v4
with:
install: true
cache: true
- name: Verify mise tools
run: mise list
- name: Lint Demo Apps
run: |
cd ${{ env.DEMO_PATH }}
if [ -f "../../Scripts/lint.sh" ]; then
../../Scripts/lint.sh
else
echo "Lint script not found - skipping"
fi
# Test code signing and archiving (no upload)
archive-demo:
name: Test Archive & Code Signing
runs-on: macos-26
needs: [build-demo]
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v4
with:
install: true
cache: true
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
bundler-cache: true
working-directory: ${{ env.DEMO_PATH }}
- name: Select Xcode
run: sudo xcode-select -s "/Applications/Xcode_26.4.app"
- name: Setup SSH for AppCerts repository
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.APPCERTS_DEPLOY_KEY }}
- name: Add GitHub to known_hosts
run: |
mkdir -p ~/.ssh
cp .github/known_hosts ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Generate keychain password
id: keychain
run: echo "password=$(openssl rand -base64 32)" >> $GITHUB_OUTPUT
- name: Generate Local.xcconfig for CI
run: |
cd ${{ env.DEMO_PATH }}
./Scripts/generate-local-xcconfig.sh
env:
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
- name: Archive both apps (test code signing)
run: |
cd ${{ env.DEMO_PATH }}
bundle exec fastlane build_only_all
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ steps.keychain.outputs.password }}
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
- name: Upload Pulse IPA
uses: actions/upload-artifact@v4
with:
name: pulse-ipa
path: ${{ env.DEMO_PATH }}/SundialCombine.ipa
retention-days: 1
- name: Upload Flow IPA
uses: actions/upload-artifact@v4
with:
name: flow-ipa
path: ${{ env.DEMO_PATH }}/SundialStream.ipa
retention-days: 1
# Automatic TestFlight deployment on v2.0.0 or main branch
deploy-testflight:
name: Deploy to TestFlight
runs-on: macos-26
needs: [archive-demo]
timeout-minutes: 90
if: |
(github.ref == 'refs/heads/v2.0.0' || github.ref == 'refs/heads/main') &&
!contains(github.event.head_commit.message, '[skip ci]')
steps:
- uses: actions/checkout@v6
- name: Download Pulse IPA
uses: actions/download-artifact@v4
with:
name: pulse-ipa
path: ${{ env.DEMO_PATH }}
- name: Download Flow IPA
uses: actions/download-artifact@v4
with:
name: flow-ipa
path: ${{ env.DEMO_PATH }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
bundler-cache: true
working-directory: ${{ env.DEMO_PATH }}
- name: Upload IPAs to TestFlight
run: |
cd ${{ env.DEMO_PATH }}
bundle exec fastlane upload_only pulse_ipa:SundialCombine.ipa flow_ipa:SundialStream.ipa
env:
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
- name: Increment build number and commit
if: success()
run: |
cd ${{ env.DEMO_PATH }}
# Read current build number
CURRENT_BUILD=$(grep "CURRENT_PROJECT_VERSION:" project.yml | sed 's/.*CURRENT_PROJECT_VERSION: "\(.*\)"/\1/')
echo "Current build number: $CURRENT_BUILD"
# Increment build number
NEW_BUILD=$((CURRENT_BUILD + 1))
echo "New build number: $NEW_BUILD"
# Update project.yml
sed -i '' "s/CURRENT_PROJECT_VERSION: \"$CURRENT_BUILD\"/CURRENT_PROJECT_VERSION: \"$NEW_BUILD\"/" project.yml
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Commit and push with [skip ci]
git add project.yml
git commit -m "chore: bump build number to $NEW_BUILD [skip ci]"
git push