Skip to content

Commit

Permalink
built Release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
polymorphicshade committed Apr 20, 2024
1 parent c44c387 commit 5b6b243
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,40 @@ on:
workflow_dispatch:

jobs:
build-and-release:

build:
runs-on: ubuntu-latest

permissions: write-all

steps:
- name: Print environment
run: env | grep ^GITHUB
- name: Checkout branch "${{ github.ref_name }}"
run: |
git clone --no-checkout https://github.com/polymorphicshade/Tubular.git .
git config core.symlinks false
git checkout --progress --force ${{ github.ref_name }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
cache: 'gradle'

- name: Decode keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
run: |
echo $ENCODED_STRING | base64 -di > app/keystore.jks
- name: Build release APK
env:
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 APK
uses: actions/upload-artifact@v4
with:
name: app
path: app/build/outputs/apk/release/*.apk
10 changes: 10 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ android {
}
}

signingConfigs {
release {
storeFile file("keystore.jks")
storePassword System.getenv("SIGNING_STORE_PASSWORD")
keyAlias System.getenv("SIGNING_KEY_ALIAS")
keyPassword System.getenv("SIGNING_KEY_PASSWORD")
}
}

buildTypes {
debug {
debuggable true
Expand All @@ -51,6 +60,7 @@ android {
}

release {
signingConfig signingConfigs.release
if (System.properties.containsKey('packageSuffix')) {
applicationIdSuffix System.getProperty('packageSuffix')
resValue "string", "app_name", "Tubular " + System.getProperty('packageSuffix')
Expand Down

0 comments on commit 5b6b243

Please sign in to comment.