2024-04-04 00:14:33 +02:00
|
|
|
#file: noinspection SpellCheckingInspection
|
|
|
|
|
|
|
|
name: CI-Android APK
|
|
|
|
|
|
|
|
env:
|
|
|
|
main_project_module: app
|
|
|
|
playstore_name: Beans
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: set up secrets
|
|
|
|
run: |
|
|
|
|
echo "${{ secrets.RELEASE_KEYSTORE }}" > keystore.asc
|
|
|
|
echo "${{ secrets.RELEASE_KEY}}" > key.asc
|
|
|
|
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch keystore.asc > app/keystore.properties
|
|
|
|
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch key.asc > app/key.jks
|
|
|
|
|
|
|
|
- uses: gradle/wrapper-validation-action@v2
|
|
|
|
|
|
|
|
- name: create and checkout branch
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
env:
|
|
|
|
BRANCH: ${{ github.head_ref }}
|
|
|
|
run: git checkout -B "$BRANCH"
|
|
|
|
|
|
|
|
- name: set up JDK
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
java-version: 17
|
|
|
|
distribution: "temurin"
|
|
|
|
cache: 'gradle'
|
|
|
|
|
|
|
|
- name: Build APK
|
2024-04-07 11:10:10 +02:00
|
|
|
run: ./gradlew assembleSignedRelease
|
2024-04-04 00:14:33 +02:00
|
|
|
|
|
|
|
# - name: Upload APK
|
|
|
|
# uses: actions/upload-artifact@v4
|
|
|
|
# with:
|
|
|
|
# name: app.apk
|
|
|
|
# path: app/build/outputs/apk/release/app-release.apk
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v2
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
files: |
|
2024-04-07 11:10:10 +02:00
|
|
|
app/build/outputs/apk/signedRelease/app-release.apk
|