aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Maxim Baz <git@maximbaz.com>2019-12-21 00:32:39 +0100
committerGravatar Mischievous Meerkat <engineerarun@gmail.com>2019-12-21 05:02:39 +0530
commitf0eba7d51b87d50e04f69e886d79cb9aa2a3c184 (patch)
treebb2bf6bcc8ba5d337fa48e4e8f5e525d42f4a36f /Makefile
parent9f7ae0e86a8322117752786f4c3ad0dc89b843b9 (diff)
downloadnnn-f0eba7d51b87d50e04f69e886d79cb9aa2a3c184.tar.gz
Improvements for distribution (#417)
* Don't pack sources (github does it better), sign sources * Make CircleCI generate the same git archive as Github, return make dist * Revert make clean too * Upload signature to Github release * Read Github token from an env variable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 43287f8..51dee97 100644
--- a/Makefile
+++ b/Makefile
@@ -92,9 +92,19 @@ dist:
gzip nnn-$(VERSION).tar
$(RM) -r nnn-$(VERSION)
+sign:
+ git archive -o nnn-$(VERSION).tar.gz --format tar.gz --prefix=nnn-$(VERSION)/ v$(VERSION)
+ gpg --detach-sign --yes nnn-$(VERSION).tar.gz
+ rm -f nnn-$(VERSION).tar.gz
+
+ $(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id))
+ curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION).tar.gz.sig' \
+ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/pgp-signature' \
+ --upload-file nnn-$(VERSION).tar.gz.sig
+
clean:
- $(RM) -f $(BIN) nnn-$(VERSION).tar.gz
+ $(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig
skip: ;
-.PHONY: all debug install uninstall strip dist clean
+.PHONY: all debug install uninstall strip dist sign clean