use secret-tool for creds & shorten download links

Amolith created

Change summary

Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Detailed changes

Makefile 🔗

@@ -2,6 +2,8 @@
 #
 # SPDX-License-Identifier: CC0-1.0
 
+TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
+
 .PHONY: default clean all aix dragonfly darwin freebsd illumos netbsd linux openbsd plan9 solaris windows
 
 default:
@@ -11,8 +13,9 @@ clean:
 	rm -rf out
 
 release: clean all
-	if ! [ -f "$HOME/.config/hut/config" ] ; then cat ~/.artifacts_token | hut init ; fi
+	if ! [ -f "$HOME/.config/hut/config" ] ; then $(secret-tool lookup Title 'SourceHut API Key') | hut init ; fi
 	for i in out/* ; do hut git artifact upload -r earl "$i" ; done
+	for i in out/* ; do curl -H "Authorization: Bearer $(secret-tool lookup Title 'earl')" "https://earl.run/update?oldName=$(basename $i)&name=$(basename $i)&url=https%3A%2F%2Fgit.sr.ht%2F~amolith%2Fearl%2Frefs%2Fdownload%2F$TAG%2F$(basename $i)" ; done
 
 all: darwin dragonfly freebsd illumos netbsd openbsd plan9 linux solaris windows