-
-
Notifications
You must be signed in to change notification settings - Fork 83
96 lines (82 loc) · 3.53 KB
/
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
name: Nightly
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
SKIP_RELEASE: "yes"
SIGNING_KEYSTORE_FILE: ./secrets/signing_key.jks
BUILD_APK_FILE: ./app/build/outputs/apk/release/app-release.apk
BUILD_AAB_FILE: ./app/build/outputs/bundle/release/app-release.aab
OUTPUT_DIR: ./dist
jobs:
nightly-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
cache: gradle
- name: 🚧 Do prerequisites
run: npm ci
- name: 🔢 Get version
id: app_version
run: echo "version=$(npm run --silent version:print-nightly)" >> $GITHUB_OUTPUT
- name: 🔎 Check for release
run: |
last_tag=$(npm run --silent git:latest-tag)
echo "SKIP_RELEASE=$(npm run --silent git:no-affects-app-yn -- $last_tag)" >> $GITHUB_ENV
env:
TAG_NAME: v${{ steps.app_version.outputs.version }}
- name: 🔨 Generate certificate
if: env.SKIP_RELEASE == 'no'
run: |
mkdir -p $(dirname $SIGNING_KEYSTORE_FILE)
echo $SIGNING_KEYSTORE_FILE_CONTENT | base64 -di > $SIGNING_KEYSTORE_FILE
env:
SIGNING_KEYSTORE_FILE_CONTENT: ${{ secrets.SIGNING_KEYSTORE_FILE }}
- name: 🔨 Build assets
if: env.SKIP_RELEASE == 'no'
run: |
npm run prebuild
chmod +x ./gradlew
./gradlew assemble
./gradlew bundle
npm run postbuild
env:
APP_VERSION_NAME: ${{ steps.app_version.outputs.version }}
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
- name: 📝 Rename assets
if: env.SKIP_RELEASE == 'no'
run: |
mkdir -p $OUTPUT_DIR
mv $BUILD_APK_FILE $OUTPUT_DIR/symphony-nightly-v$APP_VERSION_NAME.apk
mv $BUILD_AAB_FILE $OUTPUT_DIR/symphony-nightly-v$APP_VERSION_NAME.aab
env:
APP_VERSION_NAME: ${{ steps.app_version.outputs.version }}
- name: 🚀 Upload assets
if: env.SKIP_RELEASE == 'no'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.app_version.outputs.version }}
artifacts: ${{ env.OUTPUT_DIR }}/*
body: "Refer [commits of v${{ steps.app_version.outputs.version }}](https://github.com/zyrouge/symphony/commits/v${{ steps.app_version.outputs.version }}) for the changes."
generateReleaseNotes: false
draft: false
prerelease: true
artifactErrorsFailBuild: true
- name: 🔖 Was Release skipped?
if: env.SKIP_RELEASE == 'yes'
run: echo "Skipping since tag $TAG_NAME already exists"
env:
TAG_NAME: v${{ steps.app_version.outputs.version }}