-
-
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 pull request #92 from LeoAndo/release-v1.0.6
Release v1.0.6
- Loading branch information
Showing
5 changed files
with
120 additions
and
18 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 |
---|---|---|
|
@@ -2,29 +2,62 @@ name: Android CI | |
|
||
on: | ||
push: | ||
branches: [ "main", "develop", /^release\-.*$/ ] | ||
pull_request: | ||
branches: [ "main", "develop", /^release\-.*$/ ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
timeout-minutes: 60 | ||
|
||
steps: | ||
# https://github.com/styfle/cancel-workflow-action#usage | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: assembleDebug with Gradle | ||
run: ./gradlew assembleDebug | ||
- name: test with Gradle | ||
run: ./gradlew test | ||
|
||
|
||
# gradle cache | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Create local.properties | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN" >> local.properties | ||
- name: Run lint for developmentDebug the variants. | ||
run: ./gradlew lintDevelopmentDebug | ||
|
||
- name: Run unit tests for developmentDebug the variants. | ||
run: ./gradlew testDevelopmentDebugUnitTest | ||
|
||
- name: Build tasks (Assemble main outputs for developmentDebug the variants.) | ||
run: | | ||
./gradlew assembleDevelopmentDebug | ||
# https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml | ||
- name: Upload build outputs (APKs) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-outputs | ||
path: app/build/outputs | ||
|
||
- name: Upload build reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-reports | ||
path: app/build/reports |
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,50 @@ | ||
name: Android Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Create release.keystore | ||
run: echo "${{ secrets.ANDROID_STORE_BASE64 }}" | base64 -d > release.keystore | ||
|
||
- name: Create local.properties | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} | ||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
run: | | ||
echo "GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN" >> local.properties | ||
echo "ANDROID_STORE_PASSWORD=$ANDROID_STORE_PASSWORD" >> local.properties | ||
echo "ANDROID_KEY_ALIAS=$ANDROID_KEY_ALIAS" >> local.properties | ||
echo "ANDROID_KEY_PASSWORD=$ANDROID_KEY_PASSWORD" >> local.properties | ||
- name: Release Build tasks (apk and aab) | ||
run: | | ||
./gradlew assembleProductionRelease | ||
./gradlew bundleProductionRelease | ||
# https://github.com/softprops/action-gh-release#%EF%B8%8F-uploading-release-assets | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
app/build/outputs | ||
app/build/reports |
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
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
Binary file not shown.