From 2fed893571fd8e0095303fe5ab78473930ceac09 Mon Sep 17 00:00:00 2001 From: catc Date: Tue, 28 Dec 2021 21:54:04 -0800 Subject: [PATCH] fix npm publish action, update readme --- .github/workflows/publish-release.yml | 16 ++++++++++------ README.md | 8 ++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5429045..beeecf2 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -3,6 +3,7 @@ name: Publish release on: push: branches: [ master ] + workflow_dispatch: jobs: npm-publish: @@ -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 diff --git a/README.md b/README.md index 36d485a..aca1a21 100644 --- a/README.md +++ b/README.md @@ -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)