-
-
Notifications
You must be signed in to change notification settings - Fork 167
277 lines (225 loc) · 7.43 KB
/
build_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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
name: build_release
on:
workflow_call: # for beta releases from main - release.yml / dispatch_beta_release
inputs:
is_main_build:
type: boolean
required: true
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
env:
BUILD_LABEL: ${{ inputs.is_main_build && github.sha || github.ref_name }}
concurrency:
group: release
jobs:
build_docker:
uses: ./.github/workflows/docker.yml
with:
is_main_build: ${{ inputs.is_main_build || false }}
permissions:
contents: read
packages: write
build_web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download bumped version artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: release-data
- uses: actions/setup-node@v4
with:
node-version: 22
- run: corepack enable
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
- name: Build dist bundle
run: pnpm build
- name: Upload dist bundle to S3
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks --delete
env:
SOURCE_DIR: dist
AWS_S3_BUCKET: ${{ inputs.is_main_build && 'beta.vger.app' || 'vger.app'}}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Compress artifacts
run: |
zip -r Voyager-Web-$BUILD_LABEL.zip dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Voyager-Web-${{ env.BUILD_LABEL }}.zip
path: Voyager-Web-${{ env.BUILD_LABEL }}.zip
build_ios:
environment: deploy
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Download bumped version artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: release-data
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Install Fastlane
run: |
gem install bundler
bundle install
- run: corepack enable
- run: pnpm i --frozen-lockfile
- name: Build (Ionic)
run: pnpm exec ionic cap sync
env:
CI_PLATFORM: ios
- name: Deploy to TestFlight
run: |
echo "$APP_STORE_CONNECT_KEY" > authkey.json
bundle exec fastlane deploy
env:
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
COMMIT_MSG: ${{ github.event.commits[0].message }}
- name: Upload iOS IPA as artifact
uses: actions/upload-artifact@v4
with:
name: Voyager-iOS-${{ env.BUILD_LABEL }}.ipa
path: Voyager-iOS-${{ env.BUILD_LABEL }}.ipa
build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download bumped version artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: release-data
- uses: actions/setup-node@v4
with:
node-version: 22
- run: corepack enable
- run: pnpm i --frozen-lockfile
- name: Build (Ionic)
run: pnpm exec ionic cap sync
env:
BUILD_FOSS_ONLY: true
CI_PLATFORM: android
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "corretto"
cache: gradle
- name: Build (Android)
run: |
echo $ANDROID_KEYSTORE | base64 --decode > android/app/release-ci.keystore
cd android
./gradlew assembleRelease
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
- run: mv android/app/build/outputs/apk/release/app-release.apk Voyager-Android-${{ env.BUILD_LABEL }}.apk
- name: Send to Artifacts
uses: actions/upload-artifact@v4
with:
name: Voyager-Android-${{ env.BUILD_LABEL }}.apk
path: Voyager-Android-${{ env.BUILD_LABEL }}.apk
build_android_play:
environment: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download bumped version artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: release-data
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Install Fastlane
run: |
gem install bundler
bundle install
- run: corepack enable
- run: pnpm i --frozen-lockfile
- name: Build (Ionic)
run: pnpm exec ionic cap sync
env:
CI_PLATFORM: android
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "corretto"
cache: gradle
- name: Build (Android)
run: |
echo $ANDROID_KEYSTORE | base64 --decode > android/app/release-ci.keystore
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
- name: Setup service account
run: echo $GOOGLE_SERVICE_ACCOUNT | base64 --decode > android/pc-api.json
env:
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Run Fastlane
run: bundle exec fastlane android deploy
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
create_release:
needs:
- build_web
- build_ios
- build_android_play
- build_android
- build_docker
if: inputs.is_main_build != true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: Voyager-Web-${{ env.BUILD_LABEL }}.zip
path: artifacts/web
- name: Download iOS Artifact
uses: actions/download-artifact@v4
with:
name: Voyager-iOS-${{ env.BUILD_LABEL }}.ipa
path: artifacts/ios
- name: Download Android Artifact
uses: actions/download-artifact@v4
with:
name: Voyager-Android-${{ env.BUILD_LABEL }}.apk
path: artifacts/android
# https://github.com/softprops/action-gh-release/pull/372#issuecomment-1642643937
- name: Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@a57c1b7c90e56d9c8b26a6ed5d1eed159369e117 # v5.0.0
- name: Release
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
with:
body: ${{ steps.build_changelog.outputs.changelog }}
files: |
artifacts/ios/*
artifacts/android/*
artifacts/web/*