Skip to content

Commit 2fed893

Browse files
committed
fix npm publish action, update readme
1 parent f7a8603 commit 2fed893

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.github/workflows/publish-release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Publish release
33
on:
44
push:
55
branches: [ master ]
6+
workflow_dispatch:
67

78
jobs:
89
npm-publish:
@@ -15,17 +16,20 @@ jobs:
1516
node-version: '12.22.8'
1617

1718
- name: check if package.json version has been updated
18-
id: check
1919
uses: EndBug/version-check@v1
20+
if: ${{ github.event_name != 'workflow_dispatch' }}
21+
id: check
2022

2123
- name: build library
22-
if: steps.check.outputs.changed == 'true'
24+
if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
25+
env:
26+
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
2327
run: |
2428
npm run install-all
2529
npm run lib
30+
touch .npmrc
31+
echo "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}" >> ./.npmrc
2632
2733
- name: publish to npm
28-
if: steps.check.outputs.changed == 'true'
29-
env:
30-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
31-
run: npm publish --dry-run
34+
if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
35+
run: npm publish

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ Before submitting a PR, ensure that:
105105
------------
106106

107107
Other useful commands:
108-
- build docs: `npm run docs:build`
109-
- run all tests: `npm run tests`
110-
- watch tests: `npm run tests:watch`
111-
- create lib to publish npm: `npm run lib`
108+
- new npm releases:
109+
- bump version: `npm version NEW_VERSION`, commit and push - CI should publish to npm automatically
110+
- new github releases
111+
- manual (TODO - add github action)
112112

0 commit comments

Comments
 (0)