Skip to content

Commit

Permalink
Add build debug script
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Dec 4, 2024
1 parent 7754d6e commit c08d78a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Debug APK

on:
push:
branches: [ "master" ]
workflow_dispatch:

jobs:

build:
name: Build Debug APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Get application version name
run: echo "VERSION_NAME=$(($(cat app/build.gradle.kts | grep versionCode | tr -s ' ' | cut -d " " -f 4 | tr -d '\r')))" >> $GITHUB_ENV

- name: Bump application version code
uses: chkfung/[email protected]
with:
gradlePath: app/build.gradle.kts
versionName: "${{ env.VERSION_NAME }} (#${{github.run_number}})"

- name: Write sign info
if: github.repository == 'DHD2280/BCR-Manager'
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Build with Gradle
if: github.repository == 'DHD2280/BCR-Manager'
run: ./gradlew assembleRelease

- name: Upload a Build Artifact
if: github.repository == 'DHD2280/BCR-Manager'
uses: actions/upload-artifact@v4
with:
name: "BCR Manager ${{ env.VERSION_NAME }} Dev (#${{github.run_number}})"
path: app/build/outputs/apk/release/*.apk
if-no-files-found: error

0 comments on commit c08d78a

Please sign in to comment.