Skip to content

Commit

Permalink
Rename main workflow to build.yml, Add release.yml
Browse files Browse the repository at this point in the history
* 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
Kshitij09 committed Nov 1, 2021
1 parent fc784d1 commit b90353a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build & Test
on:
push:
branches: [ main ]
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
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 }}

0 comments on commit b90353a

Please sign in to comment.