diff --git a/.github/actions/publish-to-npm/action.yml b/.github/actions/publish-to-npm/action.yml new file mode 100644 index 0000000..4956cf6 --- /dev/null +++ b/.github/actions/publish-to-npm/action.yml @@ -0,0 +1,18 @@ +name: Publish to npm +on: + push: + tags: + - v*.*.* +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-node + with: + cache_version: ${{ secrets.GH_ACTIONS_CACHE_KEY }} + - run: npm install + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb160aa..3d35f08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,3 +52,10 @@ To do this, run: ```shell npm run start ``` + +## Release Process + +* Check out `main` locally and check you are synced with origin. `git checkout main && git reset origin/main --hard` +* Run `npm version major|minor|patch`, adjusting as necessary depending on the type of release. +* `git push -u origin/new-release --tags` +* Once the new tag is shared, a GitHub Action workflow will build and publish to npm automatically.