small updates #57
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
name: Build | |
on: | |
push: | |
branches: [ "dev", "main" ] | |
pull_request: | |
branches: [ "dev", "main" ] | |
workflow_dispatch: | |
jobs: | |
debug: | |
name: Build Apk | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event" | |
- run: echo "This job is running on a ${{ runner.os }} server hosted by GitHub!" | |
- uses: actions/checkout@v3 | |
- run: echo "The ${{ github.repository }} repository has been cloned" | |
- run: echo "Setting up JDK" | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- run: java --version | |
- run: env | |
- run: echo "JDK 17 has been set up" | |
- name: Set up keystore | |
run: | | |
echo "${{ secrets.PILLAPP_KEYSTORE }}" > app/keystore.jks.asc | |
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch app/keystore.jks.asc > app/keystore.jks | |
- run: echo "Keystore has been set up" | |
- name: Set up local.properties | |
run: | | |
echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc | |
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch local.properties.asc > local.properties | |
- run: echo "local.properties has been set up" | |
- run: echo "Ready to build" | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- run: echo "Building Debug APK." | |
- name: Build with Gradle | |
run: ./gradlew build | |
- run: echo "Build status report=${{ job.status }}." | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: PillApp-${{ github.run_number }}.apk | |
path: app/build/outputs/apk/debug/*.apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: PillApp-${{ github.run_number }}.apk | |
path: app/build/outputs/apk/release/*.apk | |
build: | |
name: Generate App Bundle | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Set up keystore | |
run: | | |
echo "${{ secrets.PILLAPP_KEYSTORE }}" > app/keystore.jks.asc | |
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch app/keystore.jks.asc > app/keystore.jks | |
- run: echo "Keystore has been set up" | |
- name: Set up local.properties | |
run: | | |
echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc | |
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch local.properties.asc > local.properties | |
- run: echo "local.properties has been set up" | |
- run: chmod +x gradlew | |
- name: Bundle 'release' with Gradle | |
run: ./gradlew assembleRelease | |
- name: Sign AAB | |
id: sign_aab | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY_STORE_BASE64 }} | |
alias: ${{ secrets.SIGNING_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
- run: echo "Build status report=${{ job.status }}." | |
- name: Upload App Bundle | |
uses: actions/upload-artifact@v1 | |
with: | |
name: PillApp-${{ github.run_number }}.aab | |
path: ${{steps.sign_aab.outputs.signedReleaseFile}} |