Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
fix: revert wrong version, fix bump job
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Jun 22, 2023
1 parent f2128a8 commit 1f49cdf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
22 changes: 9 additions & 13 deletions .github/actions/bump-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,30 @@ runs:
git checkout ${{ inputs.target_branch }}
# use current version from input
oldVersion=${{ inputs.base_version }}
if [ -z $oldVersion ]; then
#... or read it from gradle.properties
echo "No base_version input was given, will read base version from gradle.properties"
oldVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
fi
baseVersion=${{ inputs.base_version }}
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
# read the major, minor, and patch components, consume -SNAPSHOT
IFS=.- read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH SNAPSHOT<<<"$oldVersion"
IFS=.- read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH SNAPSHOT<<<"$baseVersion"
INC=0
# Compute new snapshot version, do not increment snapshot on non-final releases, e.g. -rc1
if [ -z $SNAPSHOT ]; then
echo "$oldVersion is a final release version, increase patch for next snapshot"
echo "$baseVersion is a final release version, increase patch for next snapshot"
INC=1
else
echo "$oldVersion is not a final release version (contains \"$SNAPSHOT\"), will not increase patch"
echo "$baseVersion is not a final release version (contains \"$SNAPSHOT\"), will not increase patch"
fi
# construct the new version
newVersion="$RELEASE_VERSION_MAJOR.$RELEASE_VERSION_MINOR.$((RELEASE_VERSION_PATCH+$INC))"-SNAPSHOT
# replace every occurrence of =$oldVersion with =$newVersion
grep -rlz "$oldVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$oldVersion/$newVersion/g"
# replace every occurrence of =$baseVersion with =$newVersion
grep -rlz "$existingVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$existingVersion/$newVersion/g"
echo "Bumped the version from $oldVersion to $newVersion"
echo "Bumped the version from $baseVersion to $newVersion"
# Commit and push to the desired branch, defaults to 'main'
git add .
git commit --message "Bump version from $oldVersion to $newVersion [skip ci]"
git commit --message "Bump version from $baseVersion to $newVersion [skip ci]"
git push origin ${{ inputs.target_branch }}
10 changes: 4 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
group=org.eclipse.edc
version=0.1.3-SNAPSHOT-SNAPSHOT

edcGradlePluginsVersion=0.1.3-SNAPSHOT-SNAPSHOT
annotationProcessorVersion=0.1.3-SNAPSHOT-SNAPSHOT
metaModelVersion=0.1.3-SNAPSHOT-SNAPSHOT

version=0.1.3-SNAPSHOT
edcGradlePluginsVersion=0.1.3-SNAPSHOT
annotationProcessorVersion=0.1.3-SNAPSHOT
metaModelVersion=0.1.3-SNAPSHOT
# information required for publishing artifacts:
edcScmConnection=scm:git:[email protected]:eclipse-edc/RegistrationService.git
edcScmUrl=https://github.com/eclipse-edc/RegistrationService.git
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ format.version = "1.1"
[versions]
assertj = "3.23.1"
awaitility = "4.2.0"
edc = "0.1.3-SNAPSHOT-SNAPSHOT"
edc = "0.1.3-SNAPSHOT"
failsafe = "3.3.1"
httpMockServer = "5.15.0"
jetbrains-annotations = "24.0.1"
Expand Down

0 comments on commit 1f49cdf

Please sign in to comment.