-
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.
Rename main workflow to build.yml, Add release.yml
* Renamed primary workflow to build.yml, focusing Build & Test of a Project * Added release.yml to draft a GitHub release on tag pushed Signed-off-by: Kshitij Patil <[email protected]>
- Loading branch information
Showing
2 changed files
with
61 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: build | ||
name: Build & Test | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
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,60 @@ | ||
name: Draft Release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
env: | ||
ORG_GRADLE_PROJECT_TAZABAZAR_RELEASE_PWD: ${{ secrets.ORG_GRADLE_PROJECT_TAZABAZAR_RELEASE_PWD }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Copy CI gradle.properties | ||
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Decrypt Release Keystore | ||
env: | ||
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }} | ||
run: ./scripts/decrypt_secrets.sh | ||
|
||
- name: Generate Cache key | ||
run: ./scripts/checksum.sh checksum.txt | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: gradle-${{ hashFiles('checksum.txt') }} | ||
|
||
- name: Build Project | ||
run: ./gradlew assembleDebug assembleRelease --stacktrace | ||
|
||
- name: Run Unit tests | ||
run: ./gradlew test -Pprod --stacktrace | ||
|
||
- name: Clean Secrets | ||
run: ./scripts/clean_secrets.sh | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
draft: true | ||
files: | | ||
app/build/outputs/apk/release/app-release.apk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |