It is so annoying that I tend to forget updating versionName and vers… #33
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: macos-latest | |
timeout-minutes: 120 | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.12.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Grant execute permission to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Build release APK | |
run: ./gradlew assembleRelease | |
- name: Sign release APK | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_release_apk | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE64 }} | |
alias: ${{ secrets.SIGNING_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.SIGNING_KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: Rename signed apk | |
run: mv ${{steps.sign_release_apk.outputs.signedReleaseFile}} app/build/outputs/apk/release/geto-${{ github.ref_name }}.apk | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload release asset | |
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/release/geto-${{ github.ref_name }}.apk | |
asset_name: geto-${{ github.ref_name }}.apk | |
asset_content_type: application/vnd.android.package-archive |