Skip to content

Update android.yml

Update android.yml #10

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/get-apk-info-action@1.0
with:
apkPath: app/build/outputs/apk/debug/app-debug.apk
- name: Tag the repository
id: tag
run: |
# See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names
TAG=v$(date -Iseconds | sed 's/[T:\+]/-/g')
echo "$TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA}
git push origin $TAG
- 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