diff --git a/Makefile b/Makefile index 5f83a0e4..1d16e1d6 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,25 @@ BABEL := $(NODE_LOCAL_BIN)/babel ESLINT := $(NODE_LOCAL_BIN)/eslint FLAKE8 := $(NODE_LOCAL_BIN)/flake8 +# In the PACKAGE_VERSION below we: +# - parse package.json +# - get the lines with version in +# - reduce to just the first of those lines +# - strip out space, " and , +# - get the real version number (e.g. version:0.1.0 -> 0.1.0) +# - change 0.1.0-alpha to 0.1.0alpha for AMO compatiblity +PACKAGE_VERSION := $(shell grep -m1 version package.json | \ + cut -d'"' -f4 | \ + sed 's/-alpha/alpha/') + +# Commands need to update the versions correctly in all places. Called from +# npm's version command as configured in package.json +.PHONY: update_version +update_version: + @sed -i '' \ + -e 's/.*<\/em:version>/$(PACKAGE_VERSION)<\/em:version>/' \ + $(ADD-ON)/install.rdf.in + $(VENV): bin/require.pip virtualenv -p python2.7 $(VENV) . $(VENV)/bin/activate && pip install -r bin/require.pip diff --git a/README.md b/README.md index 15416d82..d06b3e41 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,8 @@ Contributing Please see the [Contributing](CONTRIBUTING.md) documentation before submitting a pull request. + +Other Documentation +=================== + +* [Release instructions](docs/Releases.md) diff --git a/docs/Releases.md b/docs/Releases.md new file mode 100644 index 00000000..af389e86 --- /dev/null +++ b/docs/Releases.md @@ -0,0 +1,42 @@ +Releases +======== + +This is a description of how we create the various releases for Loop. You only +need to read it if you're doing a release, although it might be of interest for +others. + +Bumping Version Number of `master` +---------------------------------- + +Whenever a release is made, we bump the version number of master. The version of +master should always finish with `-alpha`. + +To bump the version number: + +```shell +$ # Checkout and update master according to your standard practice. +$ # Then run this command, which will run tests and bump the version numbers: +$ npm --no-git-tag-version version -alpha +$ # If successful, commit the result +$ git commit -m "Update master version following release." -a +$ # Then push the result to the repo +``` + +Where `` is the version of the add-on just released. + +Note: We don't tag alpha versions on `master`, hence the `--no-git-tag-version` + +Beta Releases of the Add-on +--------------------------- + +TBD + +Exporting Releases to mozilla-central +------------------------------------- + +TBD + +Releasing the Standalone UI +--------------------------- + +TBD diff --git a/package.json b/package.json index f7ed6880..d6159f23 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,9 @@ }, "scripts": { "test": "make test", - "start": "make runserver" + "start": "make runserver", + "preversion": "make test", + "version": "make update_version" }, "license": "MPL-2.0" }