change used Java versions for testing #132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'zulu' | |
- name: Set up JDK 11 | |
uses: actions/[email protected] | |
with: | |
java-version: 11 | |
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 11 | |
uses: actions/[email protected] | |
with: | |
java-version: 11 | |
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@v2 | |
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 11 | |
uses: actions/[email protected] | |
with: | |
java-version: 11 | |
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 |