Skip to content

Commit

Permalink
Updated: unit-test.yml
Browse files Browse the repository at this point in the history
Added: build-apk.yml
  • Loading branch information
pakka-papad committed Oct 2, 2024
1 parent fc9635d commit 180b155
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build-apk

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Build IR apk
runs-on: ubuntu-latest
needs: [unit-test]

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'

- name: Load Google Service file
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA | base64 -di > app/google-services.json

- name: Setup Local properties
env:
STORE_FILE: ${{ secrets.STORE_FILE }}
IR_STORE_FILE: ${{ secrets.IR_STORE_FILE }}
run: mkdir keys &&
echo $STORE_FILE | base64 -di > keys/store_key.jks &&
echo $IR_STORE_FILE | base64 -di > keys/ir_store_key.jks &&
echo $'STORE_FILE=${{ github.workspace }}/keys/store_key.jks\n
STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}\n
KEY_ALIAS=${{ secrets.KEY_ALIAS }}\n
KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}\n
IR_STORE_FILE=${{ github.workspace }}/keys/ir_store_key.jks\n
IR_STORE_PASSWORD=${{ secrets.IR_STORE_PASSWORD }}\n
IR_KEY_ALIAS=${{ secrets.IR_KEY_ALIAS }}\n
IR_KEY_PASSWORD=${{ secrets.IR_KEY_PASSWORD }}\n' > ./local.properties

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Build apk
run: ./gradlew assembleInternalRelease

- name: Rename apk
run: mv ./app/build/outputs/apk/internalRelease/app-internalRelease.apk ./app/build/outputs/apk/internalRelease/zen-music-ir-build-${{ github.run_number }}.apk

- name: Upload apk
uses: actions/upload-artifact@v4
with:
name: zen-music-ir-build-${{ github.run_number }}.apk
path: app/build/outputs/apk/internalRelease/
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml → .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: unit-test

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: [main, dev]

jobs:
unit-test:
test:
name: Perform Unit Testing
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -42,8 +42,8 @@ jobs:
IR_KEY_ALIAS=${{ secrets.IR_KEY_ALIAS }}\n
IR_KEY_PASSWORD=${{ secrets.IR_KEY_PASSWORD }}\n' > ./local.properties

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Run unit tests
run: ./gradlew testDebug
Expand Down

0 comments on commit 180b155

Please sign in to comment.