From 4bdc43deb3c7ad63bb21645b783f3d8c89dba567 Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Tue, 31 Dec 2024 00:47:09 -0500 Subject: [PATCH] ci: move versionCode bump to build --- .github/workflows/build.yml | 9 +++++++++ .github/workflows/publish.yml | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84a18c8..9aa99d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,6 +104,15 @@ jobs: if: ${{ inputs.build_type == 'debug' }} run: ./gradlew :app:assembleFdroidDebug --stacktrace + # bump versionCode for nightly and prerelease builds + - name: Commit and push versionCode changes + if: ${{ inputs.build_type == 'nightly' || inputs.build_type == 'prerelease' }} + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + git add versionCode.txt + git commit -m "Automated build update" + - name: Get release apk path id: apk-path run: echo "path=$(find . -regex '^.*/build/outputs/apk/fdroid/${{ inputs.build_type }}/.*\.apk$' -type f | head -1 | tail -c+2)" >> $GITHUB_OUTPUT diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a8182a6..6eca3e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -114,14 +114,6 @@ jobs: version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $5}' | tr -d '\n') echo "VERSION_CODE=$version_code" >> $GITHUB_ENV - - name: Commit and push versionCode changes - if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' }} - run: | - git config --global user.name 'GitHub Actions' - git config --global user.email 'actions@github.com' - git add versionCode.txt - git commit -m "Automated build update" - - name: Push changes if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' }} uses: ad-m/github-push-action@master