Skip to content

Update android.yml

Update android.yml #11

Workflow file for this run

name: Android CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run gradle tests
run: ./gradlew test
- name: Build apk debug project (APK)
run: ./gradlew assembleDebug
- name: Get Apk Version
id: apk
uses: JantHsueh/[email protected]
with:
apkPath: app/build/outputs/apk/debug/app-debug.apk
- name: Tag the repository
id: tag
uses: actions-ecosystem/action-push-tag@v1
with:
tag: '${{ steps.apk.outputs.versionCode }}-${{ steps.apk.outputs.versionNum }}-${{github.run_number}}'
message: '${{ steps.bump-semver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}'
- name: Upload Build to Artifacts
uses: actions/upload-artifact@v3
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: 'gridlauncher-${{ steps.apk.outputs.versionCode }}-${{ steps.apk.outputs.versionNum }}-${{github.run_number}}.apk'
path: app/build/outputs/apk/debug/app-debug.apk
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: true
files: |
app/build/outputs/apk/debug/app-debug.apk