From 0865784c1cbe33c4a0914818671a5e2859b08790 Mon Sep 17 00:00:00 2001 From: wingio Date: Mon, 20 Mar 2023 15:45:36 -0400 Subject: [PATCH] Add workflows --- .github/workflows/build-debug.yml | 40 +++++++++++++++++++++ .github/workflows/build-release.yml | 54 +++++++++++++++++++++++++++++ app/release/output-metadata.json | 4 +-- 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-debug.yml create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml new file mode 100644 index 0000000..1c8f2a3 --- /dev/null +++ b/.github/workflows/build-debug.yml @@ -0,0 +1,40 @@ +name: Build debug APK + +on: + push: + branches: + - '*' + paths-ignore: + - '**.md' + - '.idea/*' + - 'LICENSE' + pull_request: + branches: + - '*' + paths-ignore: + - '**.md' + - '.idea/*' + - 'LICENSE' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: 'temurin' + cache: 'gradle' + + - name: Build APK + run: chmod +x ./gradlew && ./gradlew assembleDebug + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: manager-debug + path: app/build/outputs/apk/debug/app-debug.apk \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..c250800 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,54 @@ +name: Build Release + +on: + workflow_dispatch: + inputs: + versionName: + required: true + description: This releases version name + default: "1.0.0" + versionCode: + required: true + description: This releases version code + default: "1000" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: 'temurin' + cache: 'gradle' + + - name: Set Version + uses: chkfung/android-version-actions@v1.1 + with: + gradlePath: app/build.gradle.kts + versionCode: ${{github.event.inputs.versionCode}} + versionName: ${{github.event.inputs.versionName}} + + - name: Build Signed APK + run: | + echo "${{ secrets.keystore }}" | base64 -d > $GITHUB_WORKSPACE/signing-key.jks + chmod +x ./gradlew + ./gradlew assembleRelease -Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/signing-key.jks -Pandroid.injected.signing.store.password=${{ secrets.keystore_password }} -Pandroid.injected.signing.key.alias=${{ secrets.key_alias }} -Pandroid.injected.signing.key.password=${{ secrets.key_password }} + + - name: Release + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + tag="${{ github.event.inputs.versionCode }}" + git tag "$tag" + git push origin "$tag" + gh release create "$tag" \ + --title "v${{ github.event.inputs.versionName }}" \ + --generate-notes \ + app/build/outputs/apk/release/app-release.apk#Manager.apk + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' \ No newline at end of file diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index b57fa20..71917e3 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 1020, - "versionName": "1.0.2", + "versionCode": 1030, + "versionName": "1.0.3", "outputFile": "app-release.apk" } ],