Skip to content

Commit

Permalink
3.6.1.2-SNAPSHOT
Browse files Browse the repository at this point in the history
-Snapshot ver
-Potential CI automatic -SNAPSHOT and version bump on release (untested)

Took 7 minutes
  • Loading branch information
Jake-Moore committed Oct 18, 2024
1 parent 1bc3a98 commit 018526d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/gradle-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,35 @@ jobs:
-H "Authorization: token $AUTH_KEY" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/gists/$GIST_ID \
-d "{\"files\": {\"kamicommon.txt\": {\"content\": \"$CONTENT\"}}}"
-d "{\"files\": {\"kamicommon.txt\": {\"content\": \"$CONTENT\"}}}"
# Automatically bump the version
# This will also automatically update the VERSION to -SNAPSHOT
# So that any PRs or commits that are merged to main won't be automatically released
# It will now require an intentional release by changing the version
- name: Increment Version
id: increment_version
run: |
# Extract the current version and split it into components
version=$current_version
major=$(echo $version | cut -d'.' -f1)
minor=$(echo $version | cut -d'.' -f2)
patch=$(echo $version | cut -d'.' -f3)
build=$(echo $version | cut -d'.' -f4)
# Increment the patch or minor version (you can customize this logic)
new_build=$((build + 1))
new_version="$major.$minor.$patch.$new_build-SNAPSHOT"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
echo "New Gradle Version: $new_version"
# Push changes to the build.gradle.kts file
- name: Update VERSION in build.gradle.kts
run: |
new_version = ${{ steps.increment_version.outputs.new_version }}
sed -i 's/^var VERSION = ".*"/var VERSION = "$new_version"/' build.gradle.kts
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "Increment version to $new_version after release"
git push
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@Suppress("PropertyName")
var VERSION = "3.6.1.1"
var VERSION = "3.6.1.2-SNAPSHOT"

plugins { // needed for the allprojects section to work
id("java")
Expand Down

0 comments on commit 018526d

Please sign in to comment.