Skip to content

Commit

Permalink
ci: try some stuff to fix version bump action (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
williscool authored Sep 27, 2024
1 parent 9658b44 commit f3f7c45
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand Down

0 comments on commit f3f7c45

Please sign in to comment.