1.16.10 #71
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Build for Android | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 18 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '18' | |
- name: Get Latest Release | |
id: release | |
uses: InsonusK/get-latest-release@v1.1.0 | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
view_top: 1 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Cache Gradle | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-android-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-android- | |
- name: Build with Gradle | |
run: | | |
./gradlew :android:packageRelease | |
./gradlew --stop | |
- name: Upload Logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: logs | |
path: ${{ github.workspace }}/android/build/outputs/logs/ | |
- name: Check Output Exists | |
run: ls -laR ${{ github.workspace }}/android/build/outputs/apk/ | |
- name: Sign APK | |
id: sign_apk | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: android/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} | |
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.ANDROID_SIGNING_KEY_PWD }} | |
keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PWD }} | |
env: | |
BUILD_TOOLS_VERSION: "30.0.3" | |
- name: Rename APK | |
run: mv ${{ steps.sign_apk.outputs.signedReleaseFile }} ${{ github.workspace }}/android/build/outputs/apk/release/bifrost_android_${{ steps.release.outputs.tag_name }}.apk | |
- name: Upload APK | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Bifrost | |
path: ${{ github.workspace }}/android/build/outputs/apk/release/bifrost_android_${{ steps.release.outputs.tag_name }}.apk | |
- name: Upload Release APK | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ${{ github.workspace }}/android/build/outputs/apk/release/bifrost_android_${{ steps.release.outputs.tag_name }}.apk | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
replacesArtifacts: false | |
omitBodyDuringUpdate: true | |
tag: ${{ steps.release.outputs.tag_name }} |