Build Release APK & prepare release draft #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Release APK & prepare release draft | |
on: | |
workflow_dispatch: | |
#inputs: | |
# version: | |
# description: 'Version to bump to' | |
# required: true | |
# default: 'patch' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Create local.properties | |
run: touch local.properties | |
- name: Decode keystore | |
run: echo ${{ secrets.SIGNATURE_KEYSTORE_BASE64 }} | base64 --decode > android-keystore.jks | |
- name: Build with Gradle | |
env: | |
SIGNATURE_KEYSTORE_PASSWORD: ${{ secrets.SIGNATURE_KEYSTORE_PASSWORD }} | |
SIGNATURE_KEY_PASSWORD: ${{ secrets.SIGNATURE_KEY_PASSWORD }} | |
SIGNATURE_KEY_ALIAS: ${{ vars.SIGNATURE_KEY_ALIAS }} | |
run: ./gradlew assembleRelease | |
- name: Read version name | |
id: read_version_name | |
uses: ActionsTools/read-json-action@main | |
with: | |
file_path: "./app/version" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.read_version_name.outputs.major }}.${{ steps.read_version_name.outputs.minor }}.${{ steps.read_version_name.outputs.patch }} | |
release_name: ${{ steps.read_version_name.outputs.major }}.${{ steps.read_version_name.outputs.minor }}.${{ steps.read_version_name.outputs.patch }} | |
body: | | |
Changes in this Release | |
- <add changes here> | |
draft: true | |
prerelease: false | |
- name: Attach APK to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./app/build/outputs/apk/lite/release/app-lite-release.apk | |
asset_name: lite.apk | |
asset_content_type: application/vnd.android.package-archive | |
#- name: Attach deobfuscation file to Release | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: ./app/build/app-r8-mapping.txt | |
# asset_name: app-r8-mapping.txt | |
# asset_content_type: text/plain |