archive-tags (538B)
- #!/bin/sh
- workdir="$(git rev-parse --show-toplevel)"
- name="$(basename "${workdir}")"
- mkdir -p "${workdir}.archives"
- git tag -l | grep '^v' | 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" || minisign -S -x "${file}.sign" -m "${file}"
- done