chore: build project on Github

This commit is contained in:
Stefan Zollinger
2024-04-10 11:11:59 +02:00
parent e53a269b4f
commit a3b2944e03

52
.github/workflows/push.yaml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Push
on:
push:
branches:
- "*"
workflow_dispatch:
jobs:
build:
name: Generate App Bundle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: gradle
- name: Make gradle executable
run: chmod +x gradlew
- name: Create env props
run: |
echo "apiUrl=${{ secrets.API_URL }}" > env.properties
echo "apiKey=${{ secrets.API_KEY }}" >> env.properties
- name: Bundle 'release' with Gradle
run: |
./gradlew assembleDebug
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- name: Sign package
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/debug
signingKeyBase64: ${{ secrets.SIGNING_KEYSTORE }}
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- run: echo "Build status report=${{ job.status }}."
- name: Upload App Bundle
uses: actions/upload-artifact@v1
with:
name: signed_apk
path: ${{steps.sign.outputs.signedReleaseFile}}