Skip to content

Commit 5614df9

Browse files
committed
workflows: Bump version after Android production release
1 parent eba498c commit 5614df9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/android_build_and_deploy.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,38 @@ jobs:
8383
bundle exec fastlane production_deploy
8484
env:
8585
OPEN_WEARABLE_APP_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.OPEN_WEARABLE_APP_ANDROID_KEYSTORE_PASSWORD }}
86+
87+
- name: Bump version after production release
88+
if: ${{ github.event.inputs.release_type == 'production' }}
89+
shell: bash
90+
env:
91+
VERSION_FILE: open_wearable/pubspec.yaml
92+
run: |
93+
# Configure Git user
94+
git config user.name "github-actions[bot]"
95+
git config user.email "github-actions[bot]@users.noreply.github.com"
96+
97+
# Read current version
98+
line=$(grep '^version:' "$VERSION_FILE")
99+
raw_version=${line#version: }
100+
version=${raw_version//\"/}
101+
echo "Current version: $version"
102+
echo "old_version=$version" >> $GITHUB_OUTPUT
103+
104+
# Split into semver and build metadata
105+
semver=${version%%+*}
106+
build=${version#*+}
107+
IFS='.' read -r major minor patch <<< "$semver"
108+
109+
# Increment patch
110+
new_patch=$((patch + 1))
111+
new_version="${major}.${minor}.${new_patch}+${build}"
112+
113+
# Update version in pubspec.yaml
114+
sed -i "s|^version: .*|version: $new_version|" "$VERSION_FILE"
115+
echo "New version set to: $new_version"
116+
117+
# Commit the bump
118+
git add "$VERSION_FILE"
119+
git commit -m "Bump version to ${major}.${minor}.${new_patch}"
120+
git push

0 commit comments

Comments
 (0)