From 36d9dabadba20e06cbacb45f81b1cd1f69fb01af Mon Sep 17 00:00:00 2001 From: 3DJ <71472458+ThreeDeeJay@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:58:45 -0400 Subject: [PATCH 1/4] Disable abortOnError to fix compilation --- Android/app/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Android/app/build.gradle b/Android/app/build.gradle index eabf17d..dcf5f43 100755 --- a/Android/app/build.gradle +++ b/Android/app/build.gradle @@ -28,6 +28,9 @@ android { path 'src/main/jni/CMakeLists.txt' } } + lintOptions { + abortOnError false + } } dependencies { From 094425e707e1936f93c3b5b84af2c99c7348ab63 Mon Sep 17 00:00:00 2001 From: 3DJ <71472458+ThreeDeeJay@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:59:54 -0400 Subject: [PATCH 2/4] Compile, upload and release debug APK --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2a0d07d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: Build + +env: + Artifacts: Android/app/build/outputs/apk/debug/app-debug.apk + Branch: ${{github.ref_name}} + GH_TOKEN: ${{ github.token }} + +on: + push: + Branches: $Branch + pull_request: + Branches: $Branch + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Clone repo and submodules + run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . #--branch ${{env.Branch}} + + - name: Get current date, commit hash and count + run: | + echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $GITHUB_ENV + echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + echo "CommitCount=$(git rev-list --count ${{env.Branch}} --)" >> $GITHUB_ENV + + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: | + cd Android + chmod +x gradlew + + - name: Build with Gradle + run: | + cd Android + ./gradlew build --warning-mode all + + - name: Upload Artifact to GitHub + uses: actions/upload-artifact@v4 + with: + name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}" + path: "${{github.workspace}}/${{env.Artifacts}}" + + - name: Release + run: | + gh release create r${{env.CommitCount}} --generate-notes --latest=false --title "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}" + gh release upload r${{env.CommitCount}} "${{env.Artifacts}}" From 6810bd84fa26e3c2c5acac9b6244e03980ef4e46 Mon Sep 17 00:00:00 2001 From: 3DJ <71472458+ThreeDeeJay@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:23:51 -0400 Subject: [PATCH 3/4] Fix compilation in non-master branches Beta --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a0d07d..6aa5fdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: run: | echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $GITHUB_ENV echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - echo "CommitCount=$(git rev-list --count ${{env.Branch}} --)" >> $GITHUB_ENV + echo "CommitCount=$(git rev-list --count HEAD)" >> $GITHUB_ENV - name: set up JDK 17 uses: actions/setup-java@v3 From c99ede801071c427e604022dabbae9da7650ff4f Mon Sep 17 00:00:00 2001 From: 3DJ <71472458+ThreeDeeJay@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:38:27 -0400 Subject: [PATCH 4/4] Clone current branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6aa5fdf..e2ff41a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Clone repo and submodules - run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . #--branch ${{env.Branch}} + run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . --branch ${{env.Branch}} - name: Get current date, commit hash and count run: |