-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f57ca91
commit 1736f75
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Name of workflow | ||
name: Build and Upload to Github | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
types: | ||
- opened | ||
- synchronize | ||
- closed | ||
workflow_dispatch: | ||
|
||
jobs: | ||
apk: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
check-latest: false | ||
|
||
# Github Runners have this by default, only for local testing | ||
- name: Setup Android SDK | ||
if: ${{ env.ACT }} | ||
uses: amyu/setup-android@v2 | ||
with: | ||
cache-disabled: true | ||
sdk-version: 34 | ||
|
||
- name: Set execution flag for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build debug APK | ||
run: bash ./gradlew assembleDebug --stacktrace --no-daemon | ||
|
||
# Don't run this step if running ACT | ||
- name: Bump version and push tag | ||
if: ${{ !env.ACT }} | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_branches: main | ||
pre_release_branches: develop | ||
default_bump: patch | ||
tag_prefix: | ||
|
||
# Don't run this step if running ACT | ||
- name: Upload debug APK to a GitHub release | ||
if: ${{ !env.ACT }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
generate_release_notes: true | ||
files: app/build/outputs/apk/debug/app-debug.apk | ||
name: Automated Release | ||
fail_on_unmatched_files: true | ||
prerelease: true |