From f3f7c4580a1ab8a29a6127f6adcd4943b9e1563f Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 27 Sep 2024 03:10:53 -0400 Subject: [PATCH] ci: try some stuff to fix version bump action (#31) --- .github/workflows/version-bump.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index cf043eea..7a0ef6ce 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -65,15 +65,23 @@ jobs: - name: Get new version id: get-version run: | - VERSION_SPACES=$(npx semantic-release --dryRun | grep -oP 'Published release \K.*? ') + VERSION_SPACES=$(npx semantic-release --dryRun | tee /dev/tty | grep -oP 'Published release \K.*? ') VERSION="${VERSION_SPACES// /}" echo "::set-output name=version::$VERSION" + - name: Log If no version to bump t + if: steps.get-version.outputs.version == '' + run: | + echo "No version to bump to!" + - name: Update versionName in build.gradle + if: steps.get-version.outputs.version run: | + echo "Updating versionName to ${{ steps.get-version.outputs.version }}" sed -i 's/versionName ".*"/versionName "${{ steps.get-version.outputs.version }}"/' android/app/build.gradle - name: Increment versionCode in build.gradle + if: steps.get-version.outputs.version run: | # Get the current versionCode CURRENT_VERSION_CODE=$(grep -oP 'versionCode\s+\K\d+' android/app/build.gradle) @@ -84,6 +92,7 @@ jobs: echo "Incremented versionCode from $CURRENT_VERSION_CODE to $NEW_VERSION_CODE" - name: Commit and push changes + if: steps.get-version.outputs.version run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action"