Skip to content

Build release artifacts and draft Github release #13

Build release artifacts and draft Github release

Build release artifacts and draft Github release #13

Workflow file for this run

name: Build release APK and prepare Github release draft
on:
# Trigger by pushing a version tag (which are protected)
push:
tags:
- 'v*.*.*'
- '!v*.*.*-*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- 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
# Build the standard version binary.
- name: Generate "premium" release APK
run: ./gradlew assemblePremiumRelease --stacktrace
- name: Sign APK using key store from repo secrets
uses: r0adkll/sign-android-release@v1
id: sign_apk
with:
releaseDirectory: app/build/outputs/apk/premium/release
signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }}
alias: orgzly-revived-20231013
keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Get version name from git tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Rename APK file
run: mv ${{steps.sign_apk.outputs.signedReleaseFile}} orgzly-revived-${{ env.VERSION }}.apk
# Now do the same for the F-Droid flavor.
- name: Generate "fdroid" release APK
run: ./gradlew assembleFdroidRelease --stacktrace
- name: Sign APK using key store from repo secrets
uses: r0adkll/sign-android-release@v1
id: sign_fdroid_apk
with:
releaseDirectory: app/build/outputs/apk/fdroid/release
signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }}
alias: orgzly-revived-20231013
keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Rename APK file
run: mv ${{steps.sign_fdroid_apk.outputs.signedReleaseFile}} orgzly-revived-fdroid-${{ env.VERSION }}.apk
# Now upload all the binaries and create a release
- name: Upload APK and create Github release draft
uses: softprops/action-gh-release@v1
with:
files: 'orgzly-revived-*.apk'
draft: true