-
-
Notifications
You must be signed in to change notification settings - Fork 21
380 lines (336 loc) · 14 KB
/
deploy-nightly.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
name: Nightly builds
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: 0 1 * * 0-3,5-6
workflow_dispatch:
inputs:
patch_version:
description: 'Provide the patch version for this release'
required: true
default: '1'
type: choice
options:
- '0'
- '1'
- '2'
- '3'
- '4'
- '5'
- '6'
- '7'
- '8'
- '9'
permissions:
contents: write
env:
# Due to a typo the last needs to be prefixed with this
RELEASE_STUPIDITY_PREFIX: '1'
jobs:
run_checker:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ inputs.patch_version != null || (steps.check-new-commits.outputs.has-new-commits == 'true' && steps.check-changelog-files.outputs.has-changelog-files == 'true') }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch the tags
- name: Check for new commits since last nightly
id: check-new-commits
shell: bash
run: |
if [ `git diff --name-only nightly-latest app native .changes | wc -l` -ne 0 ]; then
echo "has-new-commits=true" >> $GITHUB_OUTPUT ;
echo "has-new-commits=true";
else
echo "has-new-commits=false" >> $GITHUB_OUTPUT ;
echo "has-new-commits=false";
fi
- name: Check whether any changelog files are present
id: check-changelog-files
shell: bash
run: |
files=$(shopt -s nullglob;shopt -s dotglob;echo .changes/*.md)
if (( ${#files} ))
then
echo "has-changelog-files=true" >> $GITHUB_OUTPUT ;
echo "has-changelog-files=true";
else
echo "has-changelog-files=false" >> $GITHUB_OUTPUT ;
echo "has-changelog-files=false";
fi
tags:
env:
PATCH_VERSION: ${{ inputs.patch_version || 0 }}
runs-on: ubuntu-latest
needs:
- run_checker
if: ${{ needs.run_checker.outputs.should_run != 'false' }}
# Map a step output to a job output
outputs:
tag: ${{ steps.tag.outputs.tag }}
version: ${{ steps.version.outputs.version }}
msix_version: ${{ steps.msix_version.outputs.version }}
build_num: ${{ steps.build_num.outputs.build_num }}
targets: 'all'
steps:
- id: tag
run: echo "tag=`date +%F`" >> $GITHUB_OUTPUT
- id: version
run: |
VERSION=`date +1.%y.$RELEASE_STUPIDITY_PREFIX%-m%d$PATCH_VERSION`
echo "version=$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- id: msix_version
run: |
VERSION=`date +1.%y.%-m%d$PATCH_VERSION`
echo "version=$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- id: build_num
run: |
BUILD_NUM=`date +%s`
echo "build_num=$BUILD_NUM"
echo "build_num=$BUILD_NUM" >> $GITHUB_OUTPUT
create_draft_release:
runs-on: ubuntu-latest
needs:
- tags
steps:
- uses: actions/checkout@v4
# create temporary release to upload assets to
- name: Create Draft Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create nightly-${{ needs.tags.outputs.tag }} \
--prerelease --draft \
--title "Nightly ${{ needs.tags.outputs.tag }}"
build:
uses: ./.github/workflows/build-app.yml
needs:
- tags
- create_draft_release
with:
targets: android,linux,ios,macos,windows-exe # skip: windows-msix
artifacts_prefix: 'nightly-'
build_num: ${{ needs.tags.outputs.build_num }}
version: ${{ needs.tags.outputs.version }}
msix_version: ${{ needs.tags.outputs.msix_version }}
release_tag: nightly-${{ needs.tags.outputs.tag }}
release_env: 'nightly'
release: true
env_extra: "IS_NIGHTLY=true"
secrets: inherit
changelog:
uses: ./.github/workflows/build-changelog.yml
needs:
- tags
secrets: inherit
######## ## ### ## ## ###### ######## ####### ######## ######## ### ## ######## ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## #### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
######## ## ## ## ## ###### ## ## ## ######## ###### ####### ## ## ## ######## ######### ## ##
## ## ######### ## ## ## ## ## ## ## ## ######### ## ## ## ## #########
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ######## ## ## ## ###### ## ####### ## ## ######## ## ## ######## ## ## ## ## ##
google-play-store:
runs-on: ubuntu-latest
environment: release
needs:
- tags
- build
steps:
- uses: actions/download-artifact@v4
with:
name: Android
# - uses: actions/download-artifact@v4
# with:
# name: Android-debug-symbols
- name: Release Build to playstore
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }}
packageName: global.acter.a3
releaseName: ${{ needs.tags.outputs.tag }}
releaseFiles: app-release.aab
# debugSymbols: "*.symbols"
track: alpha
status: completed
#### ####### ###### ######## ######## ###### ######## ######## ## #### ###### ## ## ########
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ###### ## ###### ###### ## ###### ## ## ## #### ######### ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#### ####### ###### ## ######## ###### ## ## ######## #### ###### ## ## ##
apple-store-ios:
runs-on: macos-latest
environment: release
needs:
- tags
- changelog
- build
steps:
- uses: actions/download-artifact@v4
with:
name: iOS
- uses: actions/download-artifact@v4
with:
name: Changelog
- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- run: pip3 install codemagic-cli-tools
- name: Install App Store Connect Auth
env:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
run: |
mkdir private_keys
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode --output "private_keys/AuthKey_$APPLE_API_KEY_ID.p8"
ls -ltas private_keys
- name: Publish to Testflight
env:
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APPLE_API_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
shell: bash
run: |
app-store-connect publish --verbose --testflight --expire-build-submitted-for-review --platform=IOS --whats-new @file:CHANGELOG.md --path=*.ipa
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
rm -rf private_keys
## ## ### ###### ######## ######## ###### ######## ######## ## #### ###### ## ## ########
### ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#### #### ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ### ## ## ## ## ## ###### ###### ## ###### ## ## ## #### ######### ##
## ## ######### ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ###### ## ######## ###### ## ## ######## #### ###### ## ## ##
apple-store-mac:
runs-on: macos-latest
environment: release
needs:
- tags
- build
- changelog
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: MacOS
- uses: actions/download-artifact@v4
with:
name: Changelog
- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- run: pip3 install codemagic-cli-tools
- name: Install App Store Connect Auth
env:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
run: |
mkdir private_keys
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode --output "private_keys/AuthKey_$APPLE_API_KEY_ID.p8"
ls -ltas private_keys
- name: Publish to Testflight
env:
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APPLE_API_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
shell: bash
run: |
app-store-connect publish --verbose --testflight --expire-build-submitted-for-review --platform=MAC_OS --whats-new @file:CHANGELOG.md --path=*.pkg
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
rm -rf private_keys
### ######## ###### ## ## ### ## ## ########
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ######## ## ######### ## ## ## ## ########
######### ## ## ## ## ## ######### ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ###### ## ## ## ## ####### ## ##
publish_aur_nightly:
environment: release
needs:
- tags
- build
name: Publish AUR nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: Linux x64
- name: Patch PKGBUILD file
run: |
cp app/linux/packaging/aur/PKGBUILD PKGBUILD
VERSION=${{ needs.tags.outputs.version }}
DOWNLOAD_PATH='nightly-${{ needs.tags.outputs.tag }}\/acter-nightly-linux-x64-${{ needs.tags.outputs.version }}.tar.bz2'
MD5SUM=`md5sum acter-nightly-linux-x64-$VERSION.tar.bz2 | awk '{print $1}'`
echo "Version: $VERSION"
echo "Download Path: $DOWNLOAD_PATH"
echo "MD5Sum: $MD5SUM"
sed -i "s/%{{PKGNAME}}%/acter-nightly-bin/g" PKGBUILD
sed -i "s/%{{PKGNAME_CONFLICTS}}%/acter-bin/g" PKGBUILD
sed -i "s/%{{VERSION}}%/$VERSION/g" PKGBUILD
sed -i "s/%{{DOWNLOAD_PATH}}%/$DOWNLOAD_PATH/g" PKGBUILD
sed -i "s/%{{LINUX_MD5}}%/$MD5SUM/g" PKGBUILD
echo " --- Final PKGBUILD File "
cat PKGBUILD
- uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
name: Publish to AUR
with:
pkgname: acter-nightly-bin
pkgbuild: ./PKGBUILD
commit_username: Sari
commit_email: sari@acter.global
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Updated to ${{ needs.tags.outputs.tag }}
###### #### ######## ## ## ## ## ######## ######## ## ## ######## ## #### ###### ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######### ## ## ######## ######## ## ## ######## ## ## ###### #########
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
###### #### ## ## ## ####### ######## ## ####### ######## ######## #### ###### ## ##
publish:
environment: release
runs-on: ubuntu-latest
name: Publish
if: ${{ github.event.schedule }}
needs:
- tags
- build
- changelog
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: Changelog
- name: Configure git
run: | # make sure we have the tags and all
git fetch --prune --unshallow --tags
git config --global user.name 'Sari'
git config --global user.email 'acter-sari@users.noreply.github.com'
- name: Tag for nightly release
run: |
git tag nightly-${{ needs.tags.outputs.tag }}
git tag -f nightly-latest
git push -f origin main nightly-${{ needs.tags.outputs.tag }} nightly-latest
- name: Release
# publish this nightly release now
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload nightly-${{ needs.tags.outputs.tag }} CHANGELOG.md
gh release edit nightly-${{ needs.tags.outputs.tag }} \
--prerelease --draft=false \
--note-file CHANGELOG.md