61 lines
2.1 KiB
YAML
61 lines
2.1 KiB
YAML
name: Push
|
|
|
|
on: push
|
|
|
|
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: Get tag or commit id
|
|
id: get-version-id
|
|
uses: iawia002/get-tag-or-commit-id@v1
|
|
with:
|
|
length: 7
|
|
- name: Rename
|
|
run: mv ${{steps.sign.outputs.signedReleaseFile}} app/build/outputs/apk/debug/kirby_${{steps.get-version-id.outputs.id}}.apk
|
|
- name: Upload App Bundle
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: signed_apk
|
|
path: app/build/outputs/apk/debug/kirby_${{steps.get-version-id.outputs.id}}.apk
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: app/build/outputs/apk/debug/kirby_${{steps.get-version-id.outputs.id}}.apk
|