-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
1 changed file
with
55 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,55 @@ | ||
name: Android Debug Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Adjust this if you want to build on a different branch | ||
|
||
jobs: | ||
build_and_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build Debug APK | ||
run: ./gradlew assembleDebug | ||
|
||
- name: Upload Debug APK | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-debug | ||
path: app/build/outputs/apk/debug/*.apk | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: debug-${{ steps.get_date.outputs.date }} | ||
release_name: Debug Release ${{ steps.get_date.outputs.date }} | ||
draft: false | ||
prerelease: true | ||
|
||
- name: Upload APK to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./app/build/outputs/apk/debug/*.apk | ||
asset_name: app-debug.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
|
||
- name: Get current date | ||
id: get_date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M-%S')" |