14 [[ ! -s $version.zip ]] || exit 0
17 zipcreate=$root/zip-create
18 ziphash=$root/zip-hash
19 zmodload -F zsh/datetime b:strftime
20 git -C $vcspath cat-file -p $version | while read line ; do
21 [[ ! $line =~ ^object ]] || hsh=${${=line}[-1]}
22 [[ ! $line =~ ^tagger ]] || {
23 strftime -s sec -r "%s %z" "${${=line}[-2,-1]}"
29 strftime -s when %Y-%m-%dT%H:%M:%SZ $sec
31 $zipcreate -vcs $vcspath -mod $modname -version $version > $version.zip
32 $ziphash $version.zip > $version.ziphash
33 unzip -p $version.zip ${modname}@${version}/go.mod > $version.mod
34 printf '{"Version":"%s","Time":"%s","Origin":{"VCS":"git","URL":"%s","Ref":"refs/tags/%s","Hash":"%s"}}' \
35 $version $when $vcsurl $version $hsh > $version.info
36 totouch=($version.info $version.mod $version.zip $version.ziphash)
37 [[ -z $signkey ]] || {
38 ssh-keygen -Y sign -f $signkey -n file $version.ziphash
39 totouch=($totouch $version.ziphash.sig)
41 touch -d $when $totouch