@@ -22,10 +22,18 @@ jobs:
22
22
23
23
- name : Update version in gradle.properties
24
24
run : |
25
+ # Ensure we have the latest code
26
+ git fetch origin
27
+ git checkout main
28
+
29
+ # Update version number
25
30
sed -i '' "s/VERSION_NAME=.*/VERSION_NAME=${{ steps.get_version.outputs.VERSION }}/" gradle.properties
31
+
32
+ # Commit and push changes
26
33
git config --local user.email "action@github.com"
27
34
git config --local user.name "GitHub Action"
28
35
git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}" -a || echo "No changes to commit"
36
+ git push origin HEAD:main
29
37
30
38
- name : Create Release
31
39
uses : softprops/action-gh-release@v2
35
43
Release version ${{ steps.get_version.outputs.VERSION }}
36
44
draft : false
37
45
prerelease : false
46
+
47
+ # - name: Update to next development version
48
+ # run: |
49
+ # # Calculate next version number
50
+ # CURRENT_VERSION="${{ steps.get_version.outputs.VERSION }}"
51
+ # # Split version number
52
+ # IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
53
+ # PATCH=$((VERSION_PARTS[2] + 1))
54
+ # NEXT_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$PATCH-SNAPSHOT"
55
+
56
+ # # Update to next development version
57
+ # sed -i '' "s/VERSION_NAME=.*/VERSION_NAME=$NEXT_VERSION/" gradle.properties
58
+
59
+ # # Commit and push changes
60
+ # git config --local user.email "action@github.com"
61
+ # git config --local user.name "GitHub Action"
62
+ # git commit -m "Prepare for next development version $NEXT_VERSION" -a || echo "No changes to commit"
63
+ # git push origin HEAD:main
0 commit comments