Skip to content

Commit

Permalink
Setup GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Orzomaxx committed Nov 27, 2023
1 parent 84bca1c commit 7facc70
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build APK (debug)

on:
workflow_dispatch:
push:
branches: [master, main]
paths-ignore: ['*.md']
pull_request:
branches: [master, main]
paths-ignore: ['*.md']

jobs:
build:
runs-on: ubuntu-latest
if: ${{ contains(fromJSON('["workflow_dispatch", "pull_request"]'), github.event_name) || !startsWith(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4

- run: |
APP_VERSION="v$(cat ./app/build.gradle | grep -m1 versionName | awk -F'"' '{ print $2; }')" ||
APP_VERSION="v$(cat ./app/build.gradle.kts | grep -m1 versionName | awk -F'"' '{ print $2; }')"
echo APP_VERSION="$APP_VERSION" >> "$GITHUB_ENV"
echo APP_NAME="${{ github.event.repository.name }}_${APP_VERSION}-DEBUG#${{ github.run_number }}" >> "$GITHUB_ENV"
# Inject run number into versionName
sed -i -e 's/versionName "\([0-9\.]\+\)"/versionName "\1-${{ github.run_number }}"/' ./app/build.gradle ||
sed -i -e 's/versionName = "\([0-9\.]\+\)"/versionName = "\1-${{ github.run_number }}"/' ./app/build.gradle.kts
shell: bash
- uses: errr-maxx-builds/android-setup-build-env@master
with:
usePatchedSDK: true # custom
- uses: errr-maxx-builds/android-build-apk@master
with:
buildType: debug

- run: mv ./app/build/outputs/apk/debug/app-debug.apk "./${{ env.APP_NAME }}.apk"

- uses: errr-maxx-builds/android-sign-apk@master
with:
inputFile: ./${{ env.APP_NAME }}.apk
outputFile: ./${{ env.APP_NAME }}.apk
keyStore: ${{ secrets.SIGNING_KEYSTORE }}
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
keyAlias: ${{ secrets.SIGNING_ALIAS }}
keyPassword: ${{ secrets.SIGNING_ALIAS_PASSWORD }}

- uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}
path: ./${{ env.APP_NAME }}.apk
17 changes: 17 additions & 0 deletions .github/workflows/validate-gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Validate Gradle Wrapper

on:
push:
branches: [master, main]
paths-ignore: ['*.md']
pull_request:
branches: [master, main]
paths-ignore: ['*.md']

jobs:
validation:
name: Gradle Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
Empty file modified gradlew
100755 → 100644
Empty file.

0 comments on commit 7facc70

Please sign in to comment.