Skip to content

Commit

Permalink
adding it back?
Browse files Browse the repository at this point in the history
  • Loading branch information
techmaved committed Dec 15, 2023
1 parent 6104473 commit 43e1ea6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build an release

on:
push:
branches: main
tags:
- v*

jobs:
buildRelease:
name: Build an release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v4
- name: Setup JAVA 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17

- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}

- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.SIGNING_KEY_STORE_BASE64 }}
SIGNING_KEY_STORE_PATH: ${{ secrets.SIGNING_KEY_STORE_PATH }}

run: |
echo $ENCODED_STRING > keystore-b64.txt
base64 -d keystore-b64.txt > $env:SIGNING_KEY_STORE_PATH
- name: Build Release apk
env:
SIGNING_KEY_STORE_PATH: ${{ secrets.SIGNING_KEY_STORE_PATH }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
run: ./gradlew assembleRelease

- name: Upload Release Build to Artifacts
uses: actions/[email protected]
with:
name: release-artifacts
path: app/build/outputs/apk/release/

- name: Create Github Pre Release Release
if: ${{ endsWith(github.ref_name, 'beta') }}
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: true
files: |
app/build/outputs/apk/release/app-release.apk
- name: Create Github Release Release
if: ${{ !endsWith(github.ref_name, 'beta') }}
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: false
files: |
app/build/outputs/apk/release/app-release.apk
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {

signingConfigs {
create("release") {
storeFile = file("keystore/android_keystore.jks")
storeFile = file("keystore.jks")
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
Expand Down

0 comments on commit 43e1ea6

Please sign in to comment.