forked from subvision-soft/subvision-web
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 3.9 KB
/
Copy pathcreate-android.yml
File metadata and controls
105 lines (91 loc) · 3.9 KB
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
name: Build Android
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: develop
- name: Get next version
uses: reecetech/version-increment@2023.10.2
id: version
with:
scheme: calver
increment: patch
- name: Print version
run: echo "Version is ${{ steps.version.outputs.version }}"
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Setup Hub
shell: bash
run: sudo apt install hub
- name: install dependencies
run: npm install
- name: Build angular app
run: npm run build
# - name: Add android folder if not present
# run: if [ ! -d "./android" ]; then npx cap add android; fi
- name: Capacitor sync
run: npx cap sync
# - name: Capacitor copy
# run: npx cap copy
# TODO: Check for folder structure in README for generating splash screen
# - name: Generate icons and splash screen to android folder
# run: if [ -d "./resources" ]; then npm install @capacitor/assets --save-dev && npx capacitor-assets generate --android; fi
- name: Build app bundle for release
if: "contains(github.ref, 'master') && github.event_name != 'pull_request'"
run: cd android && ./gradlew bundle -PversionName=${{steps.version.outputs.version}} -PversionCode=${{ steps.version.outputs.major-version }}${{ steps.version.outputs.minor-version }}${{ steps.version.outputs.patch-version }} && ./gradlew assembleDebug -PversionName=${{steps.version.outputs.version}} -PversionCode=${{ steps.version.outputs.major-version }}${{ steps.version.outputs.minor-version }}${{ steps.version.outputs.patch-version }}
- name: Build app bundle
if: "!contains(github.ref, 'master')"
run: cd android && ./gradlew bundle && ./gradlew assembleDebug
- name: Extract Android signing key from env
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > android/release.jks.base64
base64 -d android/release.jks.base64 > android/release.decrypted.jks
- name: Sign dev build
run: jarsigner -keystore android/release.decrypted.jks -storepass ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} -signedjar ./android/app/build/outputs/bundle/release/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
- name: Check folder content of android output
run: ls ./android/app/build/outputs/bundle/release
- name: Upload release bundle
uses: actions/upload-artifact@v3
with:
name: app-release
path: ./android/app/build/outputs/bundle/release/app-release-signed.aab
retention-days: 60
- name: Build Release
if: "contains(github.ref, 'master') && github.event_name != 'pull_request'"
shell: bash
run: |
hub release create ${{ steps.version.outputs.version }} \
-m ${{ steps.version.outputs.version }} \
-a ./android/app/build/outputs/apk/debug/app-debug.apk
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Build pre-release
if: "contains(github.ref, 'develop') && github.event_name != 'pull_request'"
shell: bash
run: |
hub release create ${{ steps.version.outputs.version }} \
-m ${{ steps.version.outputs.version }} \
-a ./android/app/build/outputs/apk/debug/app-debug.apk \
-p
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}