diff --git a/Makefile b/Makefile index 8a8b030..a82d8a5 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ # make xpi # package Firefox -> dist/logsdu--firefox.xpi # make crx # package Chrome -> dist/logsdu--chrome.zip # make packages # both of the above (same as plain "make") +# make prune # drop packages left in dist/ by earlier versions # make clean # remove build/, dist/ and stray packages # make distclean # clean, plus node_modules/ # @@ -63,7 +64,7 @@ DIST := dist XPI := $(DIST)/$(EXT_ID)-$(VERSION)-firefox.xpi CRX := $(DIST)/$(EXT_ID)-$(VERSION)-chrome.zip -.PHONY: all firefox chrome typecheck test smoke xpi crx packages clean \ +.PHONY: all firefox chrome typecheck test smoke prune xpi crx packages clean \ distclean check-deps # The default does the lot: build both browsers and package both. Packaging is @@ -106,10 +107,21 @@ chrome: typecheck @echo "Select the folder itself; Chrome wants the directory holding manifest.json." @echo +# Drop packages left over from earlier versions. +# +# Package names carry their version, so a bump does not overwrite the previous +# build -- without this, dist/ accumulates every version ever built and it +# becomes easy to upload the wrong file to a store. dist/ is regenerated +# output: keep signed downloads from AMO somewhere else, not here. +prune: + @mkdir -p $(DIST) + @find $(DIST) -maxdepth 1 -type f \( -name '$(EXT_ID)-*.xpi' -o -name '$(EXT_ID)-*.zip' \) \ + ! -name '$(notdir $(XPI))' ! -name '$(notdir $(CRX))' \ + -print -delete | sed 's/^/removed stale package: /' + # An .xpi is just a zip of the extension directory, with the manifest at the # top level rather than inside a wrapper folder. -xpi: firefox - @mkdir -p $(DIST) +xpi: firefox prune rm -f $(XPI) cd $(FIREFOX_DIR) && zip -qr $(CURDIR)/$(XPI) . @echo @@ -129,8 +141,7 @@ xpi: firefox @echo # The Chrome Web Store takes a plain zip, and does the packing into .crx itself. -crx: chrome - @mkdir -p $(DIST) +crx: chrome prune rm -f $(CRX) cd $(CHROME_DIR) && zip -qr $(CURDIR)/$(CRX) . @echo diff --git a/VERSION b/VERSION index 9e11b32..d15723f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.3.2 diff --git a/dist/logsdu-0.3.2-chrome.zip b/dist/logsdu-0.3.2-chrome.zip new file mode 100644 index 0000000..abe4a52 Binary files /dev/null and b/dist/logsdu-0.3.2-chrome.zip differ diff --git a/dist/logsdu-0.3.2-firefox.xpi b/dist/logsdu-0.3.2-firefox.xpi new file mode 100644 index 0000000..9d5a57b Binary files /dev/null and b/dist/logsdu-0.3.2-firefox.xpi differ diff --git a/package.json b/package.json index cdfeb53..e8a93be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "logsdu", - "version": "0.3.1", + "version": "0.3.2", "description": "Browser extension that fills and submits a three-field academic portal login.", "author": "Ruben Carlo Benante ", "type": "module", diff --git a/src/manifest.json b/src/manifest.json index 6a79832..31fe973 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "logsdu", - "version": "0.3.1", + "version": "0.3.2", "description": "Saves and fills logins that password managers cannot: registration number, date of birth and document number.", "author": "Ruben Carlo Benante (Dr. Beco)", "homepage_url": "https://code.beco.cc/beco/logsdu",