logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://hacktivis.me/git/dotfiles.git

archive-tags (711B)


  1. #!/bin/sh
  2. workdir=$(git rev-parse --show-toplevel)
  3. name=$(basename ${workdir})
  4. get_minisign_pass() {
  5. # `pass show` is broken…
  6. # pass show minisign
  7. gpg --decrypt ~/.password-store/minisign.gpg 2>/dev/null
  8. }
  9. mkdir -p "${workdir}.archives"
  10. minisign-rotate
  11. git tag -l | egrep '^v?[0-9]+\.' | while read -r tag; do
  12. version=$(echo $tag | sed 's/^v//')
  13. file="${workdir}.archives/${name}-$(echo "${version}" | tr '/' '_').tar.gz"
  14. test -f "${file}" || git archive \
  15. --format tar.gz \
  16. --prefix "${name}-${version}/" \
  17. -o "${file}" \
  18. -- \
  19. "${tag}"
  20. #test -f "${file}.sig" || gpg --detach-sign "${file}"
  21. test -f "${file}.sign" || get_minisign_pass | minisign -S -x "${file}.sign" -m "${file}"
  22. done