commit: 0fae9d0e1912bb68a5dcbea3543f38ed757ebeff
parent 32a779fea699dc4cdac73af7b7844b5af94c0065
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 13 Sep 2025 23:39:11 +0200
bin/archive-tags: tarball dir instead of .archives, gpg->hiq, fallback .txt
Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Diffstat:
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/.local/bin/archive-tags b/.local/bin/archive-tags
@@ -1,21 +1,35 @@
#!/bin/sh
-reldir="/srv/web/hacktivis.me/releases/"
workdir=$(git rev-parse --show-toplevel)
name=$(basename ${workdir})
+reldir="${HOME}/Sources/tarballs/${name}/"
get_minisign_pass() {
# `pass show` is broken…
# pass show minisign
- gpg --decrypt ~/.password-store/minisign.gpg 2>/dev/null
+ # gpg --decrypt ~/.password-store/minisign.gpg 2>/dev/null
+
+ hiq -d -Fpassword host=minisign password!
+}
+
+get_tag_contents() {
+ git tag -v \
+ --format=$'%(contents:subject)%(if)%(contents:body)%(then)\n\n%(contents:body)%(end)' \
+ "$@"
}
-mkdir -p "${workdir}.archives"
+mkdir -p "${reldir}"
minisign-rotate
-git tag -l | egrep '^v?[0-9]+\.' | while read -r tag; do
- version=$(echo $tag | sed 's/^v//')
- file="${workdir}.archives/${name}-$(echo "${version}" | tr '/' '_').tar.gz"
+for tag in $(git tag -l | egrep '^v?[0-9]+\.'); do
+ version="${tag##v}"
+ file_base="${reldir}/${name}-$(echo "${version}" | tr '/' '_')"
+ file="${file_base}.tar.gz"
+
+ if test ! -s "${file_base}.txt"
+ then
+ get_tag_contents "${tag}" > "${file_base}.txt"
+ fi
if test ! -f "${file}" && test ! -f "${file}.sign"; then
year=$(git tag -v --format='%(taggerdate:format:%Y)' "$tag")
@@ -31,13 +45,14 @@ git tag -l | egrep '^v?[0-9]+\.' | while read -r tag; do
touch -d "${date_time}" "${file}"
#test -f "${file}.sig" || gpg --detach-sign "${file}"
- test -f "${file}.sign" || get_minisign_pass | signify -S -x "${file}.sign" -s "~/.minisign/${year}.key" -m "${file}"
+ test -f "${file}.sign" || get_minisign_pass | signify -S -x "${file}.sign" -s "${HOME}/.minisign/${year}.sec" -m "${file}"
touch -d "${date_time}" "${file}.sign"
+
set -- "${file}" "${file}.sign"
# Changelog/notes
- test -f "${file}.txt" && set -- "$@" "${file}.txt"
- publish-release --subdir=name "$@"
+ test -s "${file_base}.txt" && set -- "$@" "${file_base}.txt"
+ publish-release --subdir="${name}" "$@"
fi
done