Add workflows

This commit is contained in:
wingio 2023-03-20 15:45:36 -04:00
parent 4520f2a690
commit 0865784c1c
3 changed files with 96 additions and 2 deletions

40
.github/workflows/build-debug.yml vendored Normal file
View file

@ -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

54
.github/workflows/build-release.yml vendored Normal file
View file

@ -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 }}'

View file

@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 1020, "versionCode": 1030,
"versionName": "1.0.2", "versionName": "1.0.3",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],