-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (99 loc) · 3.42 KB
/
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: publish
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '9', '11', '17', '21', '22', '23' ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
id: externalSetupJava
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: build
run: ./gradlew check
env:
jdoc4droid.test.parsing.java.home: ${{ steps.externalSetupJava.outputs.path }}
upload:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_name == 'master'
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Setup keystore
run: echo "$keystore" | base64 -d - > ./keystore.jks
env:
keystore: '${{ secrets.keystore }}'
- name: build
run: ./gradlew build -DversionCode=${{ github.run_number }} -DversionName=${{ github.sha }}
env:
KEYSTORE: '../keystore.jks'
KEYSTORE_PWD: '${{ secrets.keystorePwd }}'
SIGNING_KEY: '${{ secrets.signingKey }}'
SIGNING_KEY_PWD: '${{ secrets.signingKeyPwd }}'
- name: upload apk
uses: actions/upload-artifact@v4
with:
name: prebuilt APK
path: app/build/outputs/apk/release/app-release.apk
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_name == 'master'
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Setup keystore
run: echo "$keystore" | base64 -d - > ./keystore.jks
env:
keystore: '${{ secrets.keystore }}'
- name: build
run: ./gradlew build bundle -DversionCode=${{ github.run_number }} -DversionName=${{ github.sha }}
env:
KEYSTORE: '../keystore.jks'
KEYSTORE_PWD: '${{ secrets.keystorePwd }}'
SIGNING_KEY: '${{ secrets.signingKey }}'
SIGNING_KEY_PWD: '${{ secrets.signingKeyPwd }}'
- name: changelogs
run: |
mkdir changelogs
echo -e "${{join(github.event.commits.*.message, '\n') }}" > changelogs/whatsnew-en-US
- name: upload bundle to Google Play
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: io.github.danthe1st.jdoc4droid
releaseFiles: app/build/outputs/bundle/release/app-release.aab
track: alpha
mappingFile: app/build/outputs/mapping/release/mapping.txt
whatsNewDirectory: changelogs
releaseName: ${{ github.sha }}
status: completed
- name: Publish to Huawai AppGallery
run: |
python --version
pip --version
pip install requests
python .github/workflows/scripts/appgallery_publish.py "${{secrets.APPGALLERY_APP_ID}}" "${{secrets.APPGALLERY_CLIENT_ID}}" "${{secrets.APPGALLERY_CLIENT_SECRET}}" app/build/outputs/apk/release/app-release.apk