Skip to content

Commit a4aaea2

Browse files
committed
release.sh: Update with automatic version
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent e0bcb47 commit a4aaea2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,20 @@ assign_positional_args 1 "${_positionals[@]}"
156156
set -e
157157
tagname=sscg-${_arg_version}
158158

159+
# Make sure the working directory is clean
160+
git diff --quiet HEAD --exit-code || ( echo "Working directory is dirty" && exit 2 )
161+
159162
# Make sure we are on the release branch
160163
git checkout main || ( echo "Unable to switch to main branch" && exit 2 )
161164

162165
# Fetch tags and make sure that the provided version is not already among them
163166
git fetch --tags
164167
git tag -v ${tagname} > /dev/null 2>&1 && ( echo "Tag '${tagname}' is already in use!" && exit 1 )
165168

169+
# Update the version in meson.build
170+
meson rewrite kwargs set project / version ${_arg_version}
171+
git diff --quiet HEAD --exit-code || git commit -sam "Updating version to ${_arg_version}"
172+
166173
# Tag the new release
167174
git tag -sm "Releasing SSCG ${_arg_version}" ${tagname} ${_arg_commitish}
168175

0 commit comments

Comments
 (0)