Skip to content

Commit f2a6968

Browse files
committed
new release workflow using github actions
1 parent 71b855f commit f2a6968

File tree

5 files changed

+27
-38
lines changed

5 files changed

+27
-38
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
with:
1414
node-version: '12.x'
1515
- run: npm ci
16-
- run: npm run travis
16+
- run: npm test

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@ name: npm publish
22
on:
33
release:
44
types:
5-
- created
5+
- published
66
jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/[email protected]
11-
1211
# Setup .npmrc file to publish to npm
1312
- uses: actions/[email protected]
1413
with:
1514
node-version: '12.x'
1615
registry-url: 'https://registry.npmjs.org'
17-
18-
- name: Install all npm packages
19-
run: npm install
20-
21-
- name: Publish data package to npm registry
22-
run: npm publish --access public --dry-run
16+
- run: npm install
17+
- run: npm test
18+
- run: npm publish --access public
2319
env:
2420
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/publishing.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
# Publishing a new version of MDN `data`
1+
# Publishing a new version of MDN `mdn-data`
22

3-
Repo admins publish new releases of [data](https://www.npmjs.com/package/mdn-data) on npm.
4-
This is then used by MDN to generate various sidebars and other things besides.
5-
Usually, this happens every Thursday (MDN never deploys to production on Fridays).
3+
Repo admins publish new releases of [mdn-data](https://www.npmjs.com/package/mdn-data) on npm. This is then used by MDN to generate various sidebars as well as other things.
64

7-
Any admin can complete the following steps to publish a new version, but please coordinate releases with [Chris Mills](https://github.com/chrisdavidmills).
5+
Any admin can complete the following steps to publish a new version, but please coordinate releases with [@ddbeck](https://github.com/ddbeck) or [@Rumyra](https://github.com/Rumyra).
86

9-
To create and publish a new version of `data`:
7+
The steps in this process assume:
108

11-
1. Figure out the new version number by looking at [past releases](https://github.com/mdn/data/releases). We're using only patch versions until something major changes. Lets assume the next version should be `2.0.43`.
12-
2. On your updated and clean master branch, run `npm version patch -m "43rd patch of v2"`. Locally, this updates `package.json`, creates a new commit, and creates a new release tag (see also the docs for [npm version](https://docs.npmjs.com/cli/version)).
13-
3. Push the commit to `master`: `git push origin master`. (replace `origin` with whatever your main repo remote is called).
14-
4. Check if the commit passes fine on [Travis CI](https://travis-ci.org/mdn/data).
15-
5. If Travis is happy, push the git tag as well: `git push origin v2.0.43`. (again, replace `origin` with whatever your main repo remote is called).
16-
This step will trigger Travis to publish to npm automatically (see our [.travis.yml file](https://github.com/mdn/data/blob/master/.travis.yml)).
17-
6. Check [Travis CI](https://travis-ci.org/mdn/data) again for the v2.0.43 build and also check [data on npm](https://www.npmjs.com/package/mdn-data) to see if `2.0.43` shows up correctly once Travis has finished its work.
18-
7. Notify the MDN devs about the new release.
9+
- `NPM_TOKEN` is set in the repository secrets. If the token is invalidated or unset, a member of the `@mdn` organization on npm must [create a new token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) and [add it to the repository's secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository).
10+
11+
## Publish to npm
12+
13+
1. Start a draft [release on GitHub](https://github.com/mdn/data/releases).
14+
15+
- In the _Tag version_ and _Release title_ fields, enter `vX.Y.Z` where `X.Y.Z` is the version number you'd like to publish. Do not use an existing value, but instead
16+
select an increment from the previous release. For example, if the previous release
17+
was `v2.0.20`, use `v2.0.21` for the _Tag version_ and _Release title_ fields.
18+
- You can leave the _Describe this release_ field blank, or add notes as you wish.
19+
20+
_Note_: If you're not ready to publish to npm, click **Save draft** in GitHub and resume this process later.
21+
22+
2. Click **Publish release** to create the tag and trigger the workflow that publishes to npm. Wait for the release [GitHub Actions workflow](https://github.com/mdn/data/actions) to finish successfully.
23+
24+
3. Check [`mdn-data` on npm](https://www.npmjs.com/package/mdn-data) to see if the release shows up correctly.
25+
26+
The package is now published. 🎉

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
},
3434
"scripts": {
3535
"lint": "node test/lint",
36-
"travis": "npm test",
3736
"test": "npm run lint"
3837
}
3938
}

0 commit comments

Comments
 (0)