diff --git a/Makefile b/Makefile index b1c60ce..7e0cf68 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -.PHONY: all xpi test +.PHONY: all xpi test check-env check-jwt-issuer check-jwt-secret SOURCES := $(wildcard *.js) $(wildcard lib/*.js) INSTALL_RDF_PATCH := $(abspath install.rdf.patch) +UNSIGNED_XPI := zotero-voyant-export.xpi all: xpi -xpi: zotero-voyant-export.xpi +xpi: $(UNSIGNED_XPI) -zotero-voyant-export.xpi: $(SOURCES) $(INSTALL_RDF_PATCH) +$(UNSIGNED_XPI): $(SOURCES) $(INSTALL_RDF_PATCH) rm -f $@ jpm xpi --dest-dir /tmp rm -rf /tmp/zotero-voyant-export @@ -18,3 +19,18 @@ zotero-voyant-export.xpi: $(SOURCES) $(INSTALL_RDF_PATCH) test: jpm test -b "/Applications/Nightly.app" + +check-env: check-jwt-issuer check-jwt-secret + +check-jwt-issuer: +ifndef JWT_ISSUER + $(error JWT_ISSUER is undefined) +endif + +check-jwt-secret: +ifndef JWT_SECRET + $(error JWT_SECRET is undefined) +endif + +sign: $(UNSIGNED_XPI) check-env + jpm sign --api-key $(JWT_ISSUER) --api-secret $(JWT_SECRET) --xpi $< diff --git a/README.md b/README.md index e44c1d9..172493e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ for an indication of what has been/will be done. Help is very welcome! Run `make` to create a new XPI. +Signing can be done with `make sign`, if you have the `JWT_ISSUER` and +`JWT_SECRET` environment variables set. + ### Tests Run the tests using Firefox Nightly, e.g.: diff --git a/package.json b/package.json index dddb06d..6b136d7 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "engines": { "firefox": ">=38.0a1" }, + "updateURL": "https://corajr.github.io/zotero-voyant-export/update.rdf", "license": "AGPL-3.0", "keywords": [ "jetpack"