@@ -49,7 +49,7 @@ The `grunt dev` implements watching for tests and allows for in browser testing
4949If you notice any problems, please report them to the GitHub issue tracker at
5050[ http://github.com/handlebars-lang/handlebars.js/issues ] ( http://github.com/handlebars-lang/handlebars.js/issues ) .
5151
52- ##Running Tests
52+ ## Running Tests
5353
5454To run tests locally, first install all dependencies.
5555
@@ -86,7 +86,7 @@ You can use the following scripts to make sure that the CI job does not fail:
8686- ** npm run lint** will run ` eslint ` and fail on warnings
8787- ** npm run format** will run ` prettier ` on all files
8888- ** npm run check-before-pull-request** will perform all most checks that our CI job does in its build-job, excluding the "integration-test".
89- - ** npm run integration- test** will run integration tests (using old NodeJS versions and integrations with webpack, babel and so on)
89+ - ** npm run test: integration ** will run integration tests (using old NodeJS versions and integrations with webpack, babel and so on)
9090 These tests only work on a Linux-machine with ` nvm ` installed (for running tests in multiple versions of NodeJS).
9191
9292## Releasing the latest version
@@ -101,17 +101,74 @@ Before attempting the release Handlebars, please make sure that you have the fol
101101
102102_ When releasing a previous version of Handlebars, please look into the CONTRIBUNG.md in the corresponding branch._
103103
104- A full release may be completed with the following:
105-
106- ```
107- npm ci
108- npx grunt
109- npm publish
110-
111- cd dist/components/
112- gem build handlebars-source.gemspec
113- gem push handlebars-source-*.gem
114- ```
104+ A full release via Docker may be completed with the following:
105+
106+ 1 . Create a ` Dockerfile ` in this folder for releasing
107+ ``` Dockerfile
108+ FROM node:10-slim
109+
110+ ENV EDITOR=vim
111+
112+ # Update stretch repositories
113+ RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
114+ -e 's|security.debian.org|archive.debian.org/|g' \
115+ -e '/stretch-updates/d' /etc/apt/sources.list
116+
117+ # Install release dependencies
118+ RUN apt-get update
119+ RUN apt-get install -y git vim
120+
121+ # Work around deprecated npm dependency install via unauthenticated git-protocol:
122+ # https://github.com/kpdecker/generator-release/blob/87aab9b84c9f083635c3fcc822f18acce1f48736/package.json#L31
123+ RUN git config --system url."https://github.com/" .insteadOf git://github.com/
124+
125+ # Configure git
126+ RUN git config --system user.email
"[email protected] " 127+ RUN git config --system user.name "handlebars-lang"
128+
129+ RUN mkdir /home/node/.config
130+ RUN mkdir /home/node/.ssh
131+ RUN mkdir /home/node/tmp
132+
133+ # Generate config for yo generator-release:
134+ # https://github.com/kpdecker/generator-release#example
135+ # You have to add a valid GitHub OAuth token!
136+ RUN echo "module.exports = {\n auth: 'oauth',\n token: 'GitHub OAuth token'\n };" > /home/node/.config/generator-release
137+ RUN chown -R node:node /home/node/.config
138+
139+ # Add the generated key to GitHub: https://github.com/settings/keys
140+ RUN ssh-keygen -q -t ed25519 -N
'' -f /home/node/.ssh/id_ed25519 -C
"[email protected] " 141+ RUN chmod 0600 /home/node/.ssh/id_ed25519*
142+ RUN chown node:node /home/node/.ssh/id_ed25519*
143+ ```
144+ 2. Build and run the Docker image
145+ ```bash
146+ docker build --tag handlebars:release .
147+ docker run --rm --interactive --tty \
148+ --volume $PWD:/app \
149+ --workdir /app \
150+ --user $(id -u):$(id -g) \
151+ --env NPM_CONFIG_PREFIX=/home/node/.npm-global \
152+ handlebars:release bash -c 'export PATH=$PATH:/home/node/.npm-global/bin; bash'
153+ ```
154+ 3. Add SSH key to GitHub: `cat /home/node/.ssh/id_ed25519.pub` (https://github.com/settings/keys)
155+ 4. Add GitHub API token: `vi /home/node/.config/generator-release`
156+ 5. Execute the following steps:
157+ ```bash
158+ npm ci
159+ npm install -g yo@1 grunt@1 generator-release
160+ npm run release
161+ yo release
162+ npm login
163+ npm publish
164+ yo release:publish components handlebars.js dist/components/
165+
166+ cd dist/components/
167+ gem build handlebars-source.gemspec
168+ gem push handlebars-source-*.gem
169+ ```
170+
171+ # ## After the release
115172
116173After the release, you should check that all places have really been updated. Especially verify that the `latest`-tags
117174in those places still point to the latest version
0 commit comments