This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(disabled push hook)
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
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,78 @@ | ||
name: Build and release app | ||
|
||
on: | ||
# push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Get commit hash | ||
run: echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Get commit count | ||
run: echo "CommitCount=$(git rev-list --count HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Get current date | ||
run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
|
||
- name: Set Up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
cache: 'gradle' | ||
|
||
- name: Change wrapper permissions | ||
run: chmod +x ./gradlew | ||
|
||
- name: Run gradle tests | ||
run: ./gradlew test | ||
|
||
- name: Build gradle project | ||
run: ./gradlew build | ||
|
||
- name: Build apk debug project (APK) - app module | ||
run: ./gradlew assembleDebug | ||
|
||
- name: Build apk release project (APK) - app module | ||
run: ./gradlew assemble | ||
|
||
- name: Build app bundle release (AAB) - app module | ||
run: ./gradlew app:bundleRelease | ||
|
||
- name: Upload APK Debug - ${{github.event.repository.name}} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.CurrentDate}}_${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}} - Debug | ||
path: app/build/outputs/apk/debug/ | ||
|
||
- name: Upload APK Release - ${{github.event.repository.name}} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.CurrentDate}}_${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}} - Release | ||
path: app/build/outputs/apk/release/ | ||
|
||
- name: Upload AAB (App Bundle) Release - ${{github.event.repository.name}} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.CurrentDate}}_${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}} - App bundle | ||
path: app/build/outputs/bundle/release/ | ||
|
||
- name: Copy APK | ||
run: cp "app/build/outputs/apk/debug/app-debug.apk" "app/build/outputs/apk/debug/${{github.event.repository.name}}.apk" | ||
|
||
- name: GitHub pre-release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{secrets.GITHUB_TOKEN}}" | ||
automatic_release_tag: "latest" | ||
prerelease: false | ||
title: "[${{env.CurrentDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}" | ||
files: "app/build/outputs/apk/debug/${{github.event.repository.name}}.apk" |
2 changes: 1 addition & 1 deletion
2
.github/workflows/android.yml → .github/workflows/check_for_pr.yml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Android CI | ||
name: Check for PR | ||
|
||
on: | ||
push: | ||
|