build: bump Gentoo and Void versions in release-version

Move version bumping into scripts/bump-version.sh, rename the ebuild per release, reset the Void checksum, and add make pkg-checksums to fill it after the release.
This commit is contained in:
2026-10-12 20:57:37 +02:00
parent bc85901287
commit d1d0889eb3
3 changed files with 44 additions and 6 deletions
+8 -6
View File
@@ -4,7 +4,7 @@ CONFIG_DIR := /etc/unitdore
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X github.com/warkanum/unitdore/cmd.version=$(VERSION)"
.PHONY: all build install uninstall test lint clean release-version
.PHONY: all build install uninstall test lint clean release-version pkg-checksums
all: build
@@ -42,7 +42,7 @@ lint:
clean:
rm -f $(BINARY)
## release-version: bump patch version, update source versions, commit, tag, and push
## release-version: bump patch version, update source and package versions, commit, tag, and push
release-version:
@CURRENT=$$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"); \
MAJOR=$$(echo $$CURRENT | sed 's/v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'); \
@@ -51,15 +51,17 @@ release-version:
NEXT="v$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
PKGVER="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
echo "Current: $$CURRENT → Next: $$NEXT"; \
sed -i "s/^var version = .*/var version = \"$$PKGVER\"/" cmd/root.go; \
sed -i "s/^pkgver=.*/pkgver=$$PKGVER/" pkg/arch/PKGBUILD; \
sed -i "s/^Version:.*/Version: $$PKGVER/" pkg/centos/unitdore.spec; \
git add cmd/root.go pkg/arch/PKGBUILD pkg/centos/unitdore.spec; \
scripts/bump-version.sh "$$PKGVER"; \
git add -A cmd/root.go pkg; \
git commit -m "chore(release): update package version to $$PKGVER"; \
git tag -a "$$NEXT" -m "Release $$NEXT"; \
git push origin HEAD "$$NEXT"; \
echo "Pushed $$NEXT — release workflow triggered"
## pkg-checksums: fill the Void checksum from the published release (run after release)
pkg-checksums:
scripts/update-checksums.sh
## help: show this help
help:
@grep -E '^## ' Makefile | sed 's/## / /'