Skip to content

Commit

Permalink
fix npm publish action, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
catc committed Dec 29, 2021
1 parent f7a8603 commit 2fed893
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Publish release
on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
npm-publish:
Expand All @@ -15,17 +16,20 @@ jobs:
node-version: '12.22.8'

- name: check if package.json version has been updated
id: check
uses: EndBug/version-check@v1
if: ${{ github.event_name != 'workflow_dispatch' }}
id: check

- name: build library
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
env:
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm run install-all
npm run lib
touch .npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}" >> ./.npmrc
- name: publish to npm
if: steps.check.outputs.changed == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: npm publish --dry-run
if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
run: npm publish
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Before submitting a PR, ensure that:
------------

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

0 comments on commit 2fed893

Please sign in to comment.