Skip to content

Commit 895739a

Browse files
committed
Makefile: Improve the release target
Update the "release" target so it updates the version in internal/version/version.go back to the previous value, which is usually something like "X.Y-SNAPSHOT", and commit the change. (cherry picked from commit 52bd695)
1 parent ec8480d commit 895739a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ endif
202202
set -e -o pipefail; \
203203
cp internal/version/version.go internal/version/version.go.OLD && \
204204
cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \
205-
rm internal/version/version.go.OLD && \
206205
go vet internal/version/version.go && \
207206
go fmt internal/version/version.go && \
208207
git diff --color-words internal/version/version.go | tail -n 1; \
@@ -217,8 +216,14 @@ endif
217216
git tag --annotate v$(version) --message 'Release $(version)'; \
218217
echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \
219218
echo "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n"; \
219+
mv internal/version/version.go.OLD internal/version/version.go && \
220+
git add internal/version/version.go && \
221+
original_version=`cat internal/version/version.go | sed -ne 's;^const Client = "\(.*\)"$$;\1;p'` && \
222+
git commit --no-status --quiet --message "Update version to $$original_version"; \
223+
echo "\033[2m→ Version updated to [$$original_version].\033[0m\n"; \
220224
else \
221225
echo "Aborting..."; \
226+
rm internal/version/version.go.OLD; \
222227
exit 1; \
223228
fi; \
224229
}

0 commit comments

Comments
 (0)