-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (75 loc) · 2.84 KB
/
release-android.yaml
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
name: Build for Android
on:
push:
tags:
- 'v*.*.*'
- 'android-v*.*.*'
env:
CI: false
jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.*
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Extract version from tag
uses: damienaicheh/[email protected]
- name: Update package.json files
shell: bash
run: node cli/update_version.js '${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}${{ env.PRE_RELEASE }}'
- name: Install app dependencies
shell: bash
run: npm install
- name: Build Minotaur JS app and update capacitor
shell: bash
run: npm run sync
- name: Setup Android build environment
uses: android-actions/setup-android@v3
- name: Grant execute permission for gradlew
run: chmod +x ./android/gradlew
- name: Update AndroidManifest.xml
uses: damienaicheh/[email protected]
with:
android-manifest-path: './android/app/src/main/AndroidManifest.xml'
version-code: ${{ env.NUMBER_OF_COMMITS }}
version-name: '${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}${{ env.PRE_RELEASE }}'
print-file: true
- name: Update gradle version for Android
uses: damienaicheh/[email protected]
with:
build-gradle-path: './android/app/build.gradle'
version-code: ${{ env.NUMBER_OF_COMMITS }}
version-name: '${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}${{ env.PRE_RELEASE }}'
print-file: true
- name: Build app bundle
working-directory: android
run: ./gradlew clean app:assembleRelease
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
# ID used to access action output
id: sign_app
env:
BUILD_TOOLS_VERSION: 34.0.0
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEYSTORE }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
- name: move apk to root directory
run: mv ${{steps.sign_app.outputs.signedReleaseFile}} minotaur-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}${{ env.PRE_RELEASE }}.apk
- name: Upload Apk File to release
uses: softprops/action-gh-release@v1
with:
files: minotaur*.apk
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}