Skip to content

Release APK

Release APK #21

Workflow file for this run

name: Release APK
env:
main_project_module: app
on:
# Allows to run this workflow automatically when a tag is pushed
create:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Cache Gradle and wrapper
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Run tests
run: ./gradlew test
- name: Build project
run: ./gradlew build
- name: Build Debug APK
run: ./gradlew assembleDebug
- name: Create Github Release
env:
GH_PAT: ${{ secrets.GH_PAT }}
tag: ${{ github.ref_name }}
run: |
gh auth login --with-token <<< "$GH_PAT"
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--generate-notes
- name: Upload Debug APK to Github Release
env:
GH_PAT: ${{ secrets.GH_PAT }}
tag: ${{ github.ref_name }}
run: |
gh auth login --with-token <<< "$GH_PAT"
gh release upload "$tag" ./app/build/outputs/apk/debug/app-debug.apk --clobber