Skip to content

Merge pull request #47 from amberin/build-app-bundle-in-release-workf… #1

Merge pull request #47 from amberin/build-app-bundle-in-release-workf…

Merge pull request #47 from amberin/build-app-bundle-in-release-workf… #1

Workflow file for this run

name: Build pre-release artifacts and draft Github release
on:
# Trigger by pushing a version tag (which are protected)
push:
tags:
- v*.*.*-*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
build-prerelease:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get version name from git tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- 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
# F-Droid APK
- name: Assemble F-Droid APK
run: ./gradlew assembleFdroidRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename F-Droid APK file
run: mv app/build/outputs/apk/fdroid/release/app-fdroid-release-unsigned.apk orgzly-revived-fdroid-${{ env.VERSION }}.apk
# "Premium" APK
- name: Add Dropbox app identifier
shell: bash
run: |
echo "dropbox.app_key = \"${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties
echo "dropbox.app_key_schema = \"db-${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties
- name: Assemble "premium" APK
run: ./gradlew assemblePremiumRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename "premium" APK file
run: mv app/build/outputs/apk/premium/release/app-premium-release-unsigned.apk orgzly-revived-${{ env.VERSION }}.apk
# "Premium" AAB
- name: Assemble "premium" AAB
run: ./gradlew bundlePremiumRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename "premium" AAB file
run: mv app/build/outputs/bundle/premiumRelease/app-premium-release.aab orgzly-revived-${{ env.VERSION }}.aab
- name: Upload artifacts and create Github pre-release draft
uses: softprops/action-gh-release@v1
with:
files: |
*.apk
*.aab
prerelease: true
draft: true