@@ 5,26 5,45 @@ packages:
- gdk-pixbuf2
- glib2
- gnupg
- - xz
+ - zstd
sources:
- https://hg.sr.ht/~ser/gocryptkeeper
environment:
PROJ: gocryptkeeper
- BNAME: gocryptkeeper-latest
+ TARGETS: linux:amd64
secrets:
- 45926939-38b0-4e7f-bfa5-1a5b5786a773
- d7d86c19-5b94-4c65-bf07-b8b30f55bd63
tasks:
- build: |
cd ${PROJ}
- T=$(hg log -r "." --template "{latesttag}\n")
- [[ $T == "" ]] && T=$(hg bookmark -l . --template '{bookmarks}-{node|short}\n')
- go build -o ${BNAME} -ldflags="-X main.Version=$T -s -w" .
+ export VERSION=`hg log -r tip --template '{bookmarks}'`
+ [[ $VERSION == "" ]] && VERSION=dev
+ for T in ${TARGETS}; do
+ export GOOS=$(echo $T | cut -d: -f1)
+ export GOARCH=$(echo $T | cut -d: -f2)
+ export GOARM=$(echo $T | cut -d: -f3)
+ export ASSET=${PROJ}-${GOOS}-${GOARCH}${GOARM}-${VERSION}
+ [[ -z $GOARM ]] && unset GOARM
+ [[ $GOOS == "windows" ]] && ASSET=${ASSET}.exe
+ go build -ldflags "-X main.Version=${VERSION} -s -w" -v -o ${ASSET} ${SOURCE}
+ done
- upload: |
cd ${PROJ}
- Z=${BNAME}.xz
- S=${Z}.sig
- xz ${BNAME}
- gpg -b --local-user ECE3F91E646A3FAB5D4DED0F5E0D7ABD6668FDD1 ${Z}
- curl --netrc-file ~/.downloads -T ${Z} https://downloads.ser1.net/files/
- curl --netrc-file ~/.downloads -T ${S} https://downloads.ser1.net/files/
+ export VERSION=`hg log -r tip --template '{bookmarks}'`
+ [[ $VERSION == "" ]] && exit
+ export PROJURL="https://downloads.ser1.net/files/${PROJ}/"
+ [[ `curl --netrc-file ~/.downloads -X PROPFIND $PROJURL` == "Not Found" ]] && curl --netrc-file ~/.downloads -X MKCOL ${PROJURL}
+ for T in ${TARGETS}; do
+ export GOOS=$(echo $T | cut -d: -f1)
+ export GOARCH=$(echo $T | cut -d: -f2)
+ export ASSET=${PROJ}-${GOOS}-${GOARCH}-${VERSION}
+ export LATEST=${PROJ}-${GOOS}-${GOARCH}-latest
+ if [[ $GOOS == "windows" ]] && ASSET=${ASSET}.exe
+ zstd ${ASSET}
+ gpg -b --local-user ECE3F91E646A3FAB5D4DED0F5E0D7ABD6668FDD1 ${ASSET}.zst
+ curl --netrc-file ~/.downloads -T ${ASSET}.zst ${PROJURL}
+ curl --netrc-file ~/.downloads -T ${ASSET}.zst.sig ${PROJURL}
+ curl --netrc-file ~/.downloads -T ${ASSET}.zst ${PROJURL}${LATEST}.zst
+ curl --netrc-file ~/.downloads -T ${ASSET}.zst.sig ${PROJURL}${LATEST}.zst.sig
+ done
@@ 3,7 3,7 @@ gocryptkeeper
[File bug reports here.](https://todo.sr.ht/~ser/gocryptkeeper)
-[](https://builds.sr.ht/~ser/gocryptkeeper?)
+[](https://builds.sr.ht/~ser/gocryptkeeper/.build.yml?)

@@ 31,10 31,10 @@ CGO_ENABLED=1 go build .
```
There is an *extremely* YMMV
-[binary available](https://downloads.ser1.net/gocryptkeeper-latest.xz).
-It's XZ compressed, so you'll have to uncompress it with xz before
+[binary available](https://downloads.ser1.net/gocryptkeeper/gocryptkeeper-latest.zst).
+It's ZSTD compressed, so you'll have to uncompress it with `zstd -d` before
using. There's a corresponding
-[GPG signature](https://downloads.ser1.net/gocryptkeeper-latest.lz.sig),
+[GPG signature](https://downloads.ser1.net/gocryptkeeper/gocryptkeeper-latest.zst.sig),
signed with the key 7ABD6668FDD1, which you
can find by key on public keyservers -- pgp.mit.edu, pgp.key-server.io, etc.