-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (66 loc) · 2.54 KB
/
release_build.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
name: Build release packages for Google Play and standalone publishing
on:
push:
# Run for releases and release candidates.
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
workflow_dispatch:
env:
java_version: "17"
jobs:
build:
runs-on: ubuntu-latest
environment:
name: Releases
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create signing configuration files
run: |
echo "$PLAY_UPLOAD_SIGNING_PROPERTIES" > app/play-upload-signing.properties
echo "$STANDALONE_RELEASE_SIGNING_PROPERTIES" > app/standalone-release-signing.properties
shell: bash
env:
PLAY_UPLOAD_SIGNING_PROPERTIES: ${{secrets.PLAY_UPLOAD_SIGNING_PROPERTIES}}
STANDALONE_RELEASE_SIGNING_PROPERTIES: ${{secrets.STANDALONE_RELEASE_SIGNING_PROPERTIES}}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "${{env.java_version}}"
distribution: corretto
- name: Check if build version matches the tag
run: |
buildVersion="$(./gradlew -q printVersionName)"
tagVersion="${GITHUB_REF#refs/tags/}"
if [ "$buildVersion" != "$tagVersion" ]; then
echo "Build version '$buildVersion' doesn't match the tag '$tagVersion'"
exit 1
fi
shell: bash
env:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
- name: Build Testnet APK for standalone release
run: ./gradlew app:assembleTstnetRelease --stacktrace
env:
CONFIGURABLE_SIGNING_PROPERTIES_FILE: standalone-release-signing.properties
- name: Build Testnet bundle for Google Play upload
run: ./gradlew app:bundleTstnetRelease --stacktrace
env:
CONFIGURABLE_SIGNING_PROPERTIES_FILE: play-upload-signing.properties
- name: Build Mainnet APK for standalone release
run: ./gradlew app:assembleMainnetRelease --stacktrace
env:
CONFIGURABLE_SIGNING_PROPERTIES_FILE: standalone-release-signing.properties
- name: Build Mainnet bundle for Google Play upload
run: ./gradlew app:bundleMainnetRelease --stacktrace
env:
CONFIGURABLE_SIGNING_PROPERTIES_FILE: play-upload-signing.properties
- name: Upload the APKs and bundles
uses: actions/upload-artifact@v4
with:
name: APKs and bundles
path: |
app/build/outputs/**/*.apk
app/build/outputs/**/*.aab
compression-level: 0