Skip to content

Commit 8e9d184

Browse files
authored
chore: automate npm publishing (#326)
1 parent baed8b7 commit 8e9d184

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.github/workflows/release-please.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ jobs:
1818
token: ${{ steps.get-token.outputs.token }}
1919
release-type: node
2020
package-name: '@netlify/open-api'
21+
- uses: actions/checkout@v2
22+
if: ${{ steps.release.outputs.release_created }}
23+
- uses: actions/setup-node@v2
24+
with:
25+
node-version: '14'
26+
registry-url: 'https://registry.npmjs.org'
27+
if: ${{ steps.release.outputs.release_created }}
28+
- run: npm publish
29+
if: ${{ steps.release.outputs.release_created }}
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
runs-on: ${{ matrix.os }}
1818
steps:
1919
- name: Install Node.js ${{ matrix.node }}
20-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v2
2121
with:
2222
node-version: ${{ matrix.node_version }}
2323
- name: Git checkout
24-
uses: actions/checkout@v1
24+
uses: actions/checkout@v2
2525
- name: Install dependencies
26-
run: npm install
26+
run: npm ci
2727
- name: Tests
2828
run: npm test
2929
test-go:

CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ You may first want to edit swagger.yml to add your field or endpoint definitions
4040

4141
## Making a new release
4242

43-
1. Merge the release PR (auto generated via `release-please`).
44-
2. Switch to the default branch git checkout master.
45-
3. Pull latest changes git pull.
46-
4. Run `npm publish`.
43+
Merge the release PR (auto generated via `release-please`)
4744

4845
## License
4946

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"url": "git+https://github.com/netlify/open-api.git"
5050
},
5151
"scripts": {
52+
"prepublishOnly": "npm ci && npm test",
5253
"prepare": "run-s test",
5354
"test": "run-s lint build unit",
5455
"start": "run-s lint build",

0 commit comments

Comments
 (0)