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:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Usage: scripts/bump-version.sh X.Y.Z
|
||||
# Updates the version in source and every package definition.
|
||||
# Run from the repo root. Void checksum is reset: fill it with
|
||||
# scripts/update-checksums.sh once the release tarball exists.
|
||||
set -eu
|
||||
|
||||
VER="${1:?usage: $0 X.Y.Z}"
|
||||
EBUILD_DIR=pkg/gentoo/app-containers/unitdore
|
||||
|
||||
sed -i "s/^var version = .*/var version = \"$VER\"/" cmd/root.go
|
||||
sed -i "s/^pkgver=.*/pkgver=$VER/" pkg/arch/PKGBUILD
|
||||
sed -i "s/^Version:.*/Version: $VER/" pkg/centos/unitdore.spec
|
||||
|
||||
# Gentoo: the version lives in the ebuild file name
|
||||
OLD_EBUILD=$(ls "$EBUILD_DIR"/unitdore-*.ebuild | head -n1)
|
||||
NEW_EBUILD="$EBUILD_DIR/unitdore-$VER.ebuild"
|
||||
[ "$OLD_EBUILD" = "$NEW_EBUILD" ] || git mv "$OLD_EBUILD" "$NEW_EBUILD"
|
||||
|
||||
# Void: version bump invalidates the checksum
|
||||
sed -i -e "s/^version=.*/version=$VER/" \
|
||||
-e "s/^revision=.*/revision=1/" \
|
||||
-e "s/^checksum=.*/checksum=UPDATE_AFTER_RELEASE/" pkg/void/srcpkgs/unitdore/template
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Usage: scripts/update-checksums.sh
|
||||
# Fills the Void template checksum from the published release source tarball.
|
||||
# Run from the repo root after the release workflow has finished.
|
||||
set -eu
|
||||
|
||||
T=pkg/void/srcpkgs/unitdore/template
|
||||
VER=$(sed -n 's/^version=//p' "$T")
|
||||
URL="https://git.warky.dev/wdevs/unitdore/releases/download/v$VER/unitdore-v$VER-source.tar.gz"
|
||||
|
||||
SUM=$(curl -fsSL "$URL" | sha256sum | cut -d' ' -f1)
|
||||
sed -i "s/^checksum=.*/checksum=$SUM/" "$T"
|
||||
echo "void checksum for v$VER: $SUM"
|
||||
Reference in New Issue
Block a user