Repository navigation
251 lines (222 loc) · 8.85 KB
/
Copy pathrelease.yml
File metadata and controls
251 lines (222 loc) · 8.85 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Release plugin
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: Existing version tag to build (for example v0.1.100)
required: true
type: string
permissions:
contents: read
concurrency:
group: release-${{ inputs.tag || github.ref }}
cancel-in-progress: false
jobs:
build:
runs-on: xcode-27
timeout-minutes: 120
permissions:
contents: read
actions: read
outputs:
tag: ${{ steps.release.outputs.tag }}
version: ${{ steps.release.outputs.version }}
env:
DEVELOPER_DIR: /Applications/Xcode_27.app/Contents/Developer
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: refs/tags/${{ inputs.tag || github.ref_name }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22.23.2'
cache: npm
cache-dependency-path: |
package-lock.json
runtimes/agent-device/package-lock.json
runtimes/serve-emu/package-lock.json
- name: Validate release version and tag
id: release
env:
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
run: |
git show-ref --verify "refs/tags/$RELEASE_TAG"
node scripts/release-metadata.mjs
- name: Check Sentry configuration
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
run: |
test -n "$SENTRY_AUTH_TOKEN" || { echo 'Set the SENTRY_AUTH_TOKEN repository secret.'; exit 1; }
test -n "$SENTRY_ORG" || { echo 'Set the SENTRY_ORG repository secret.'; exit 1; }
- name: Prepare native build tools
run: |
test "$(uname -m)" = arm64
xcodebuild -version
xcrun swift --version
brew install cmake ninja pkgconf openssl@3 autoconf automake libtool
rustup toolchain install 1.98.1 --profile minimal
rustup default 1.98.1
android_sdk_manager="${ANDROID_HOME:?}/cmdline-tools/latest/bin/sdkmanager"
test -x "$android_sdk_manager"
"$android_sdk_manager" --version
"$android_sdk_manager" --sdk_root="$ANDROID_HOME" --install 'ndk;27.2.12479018'
test -x "$ANDROID_HOME/ndk/27.2.12479018/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.2.12479018" >> "$GITHUB_ENV"
- name: Install JavaScript runtimes
run: |
npm ci --no-audit --no-fund
npm run lint:commits -- --last --verbose
npm run vendor:agent-device
npm run vendor:serve-emu
- name: Restore or build native helpers with matching symbols
id: native
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/release-native.mjs
- name: Run tests
run: |
npm test
npm run typecheck:telemetry
- name: Build and package the release
run: |
npm run build:release
npm run package:release
- name: Validate the extracted release ZIP
env:
RELEASE_ARCHIVE: ${{ steps.release.outputs.archive }}
run: |
unzip -t "$RELEASE_ARCHIVE"
mkdir "$RUNNER_TEMP/mobile-dev-release"
unzip -q "$RELEASE_ARCHIVE" -d "$RUNNER_TEMP/mobile-dev-release"
npm run test:package -- "$RUNNER_TEMP/mobile-dev-release"
- name: Upload Sentry source maps and native symbols
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
run: npm run sentry:upload
- name: Save release ZIP
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: mobile-dev-${{ steps.release.outputs.version }}-darwin-arm64
path: ${{ steps.release.outputs.archive }}
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable Baguette build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs.baguette }}
path: release/native-artifacts/baguette.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable iOS FPS build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs['ios-fps'] }}
path: release/native-artifacts/ios-fps.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable iOS mirror build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs['ios-mirror'] }}
path: release/native-artifacts/ios-mirror.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable iOS logs build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs['ios-logs'] }}
path: release/native-artifacts/ios-logs.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable Android FPS build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs['android-fps'] }}
path: release/native-artifacts/android-fps.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
- name: Save reusable Android CPU build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.native.outputs['android-cpu'] }}
path: release/native-artifacts/android-cpu.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 30
release:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: refs/tags/${{ needs.build.outputs.tag }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22.23.2'
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: mobile-dev-${{ needs.build.outputs.version }}-darwin-arm64
path: release
- name: Publish GitHub release with linked commit titles
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
RELEASE_VERSION: ${{ needs.build.outputs.version }}
run: |
gh api "repos/$GH_REPO/releases" --paginate \
--jq '.[] | select(.draft == false) | .tag_name' > "$RUNNER_TEMP/published-release-tags.txt"
node scripts/release-notes.mjs \
"$RUNNER_TEMP/published-release-tags.txt" "$RUNNER_TEMP/release-notes.md"
gh release create "$RELEASE_TAG" \
"release/mobile-dev-$RELEASE_VERSION-darwin-arm64.zip" \
--verify-tag --notes-file "$RUNNER_TEMP/release-notes.md" --title "Mobile Dev $RELEASE_VERSION"
publish:
needs: [build, release]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
concurrency:
group: release-latest
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: refs/tags/${{ needs.build.outputs.tag }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22.23.2'
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: mobile-dev-${{ needs.build.outputs.version }}-darwin-arm64
path: release
- name: Publish the prebuilt Git marketplace
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
RELEASE_VERSION: ${{ needs.build.outputs.version }}
RELEASE_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}.git
run: |
mkdir "$RUNNER_TEMP/mobile-dev-marketplace"
unzip -q "release/mobile-dev-$RELEASE_VERSION-darwin-arm64.zip" -d "$RUNNER_TEMP/mobile-dev-marketplace"
node scripts/publish-release.mjs "$RUNNER_TEMP/mobile-dev-marketplace"