Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Update docs when a new Electron release becomes latest #830

Closed
zeke opened this issue Nov 14, 2017 · 2 comments
Closed

Update docs when a new Electron release becomes latest #830

zeke opened this issue Nov 14, 2017 · 2 comments
Labels
area:docs Issues or Pull Requests related to /docs page on website enhancement New feature or request

Comments

@zeke
Copy link
Contributor

zeke commented Nov 14, 2017

When a new version of Electron is published to npm and tagged with the latest dist-tag, it should be displayed on the website right away. One way to solve this would be to make the website update and publish the electron-i18n module, data/versions.json, and data/releases.json in response to an npm publish hook.

That flow could look something like this:

Set up npm and Heroku buildpacks that will create a .netrc so the app can git push to GitHub and a .npmrc so the app can npm publish:

heroku buildpacks:add -i 1 https://github.com/zeke/github-buildpack
heroku buildpacks:add -i 2 https://github.com/zeke/npm-buildpack
heroku buildpacks:add -i 3 heroku/nodejs
heroku config:set GITHUB_AUTH_TOKEN=YOUR_TOKEN
heroku config:set NPM_AUTH_TOKEN=YOUR_TOKEN

Set up an npm hook. Point the hook at POST /publish or similar and store the npm hook shared secret in an env var.

In the hook handler, runnpm run release in an async child process.

The release script (which already exists from the Jekyll days) should be updated to do something like this:

# configure git
git config user.email "electron@github.com"
git config user.name "Electron Bot"

# publish a new electron-i18n
git clone https://github.com/electron/electron-i18n i18n
cd i18n
npm install
npm run collect
npm run build
npm test
npm publish

# update versions.json and releases.json in the site
cd ..
git clone https://github.com/electron/electron.atom.io site
cd site
npm install

# run each build script independently and commit changes atomically
npm run build-versions
if [[ $(git status --porcelain) != "" ]]; then
  git add .
  git commit -avm "update versions"
fi

npm run build-releases
if [[ $(git status --porcelain) != "" ]]; then
  git add .
  git commit -avm "update releases"
fi

# test it all before pushing
npm test
git push origin HEAD
@zeke
Copy link
Contributor Author

zeke commented Nov 14, 2017

The site auto-deploys when a change lands on the default branch.

@zeke
Copy link
Contributor Author

zeke commented Nov 15, 2017

cc @vanessayuenn

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:docs Issues or Pull Requests related to /docs page on website enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant