Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GitHub to build & publish APK to GitHub Releases #148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish a build


on:
workflow_dispatch:
push:
tags:
- 'v*'


jobs:
build:
name: Build for Android
runs-on: ubuntu-latest
timeout-minutes: 30

defaults:
run:
working-directory: ./android

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
cache: 'gradle'

- name: Build APK
run: ./gradlew :app:assembleDebug

- name: Create release on GitHub
uses: softprops/action-gh-release@v2
if: startsWith(github.ref_name, 'v')
with:
name: ${{ github.ref_name }}
fail_on_unmatched_files: true
# see https://github.com/softprops/action-gh-release/issues/158
files: |
build/app/outputs/apk/debug/app-debug.apk