archive-tags (711B)
- #!/bin/sh
- workdir=$(git rev-parse --show-toplevel)
- name=$(basename ${workdir})
- get_minisign_pass() {
- # `pass show` is broken…
- # pass show minisign
- gpg --decrypt ~/.password-store/minisign.gpg 2>/dev/null
- }
- mkdir -p "${workdir}.archives"
- 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"
- test -f "${file}" || git archive \
- --format tar.gz \
- --prefix "${name}-${version}/" \
- -o "${file}" \
- -- \
- "${tag}"
- #test -f "${file}.sig" || gpg --detach-sign "${file}"
- test -f "${file}.sign" || get_minisign_pass | minisign -S -x "${file}.sign" -m "${file}"
- done