0.1.10 #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release (npm) | |
on: | |
push: | |
branches: [ main ] # run on main pushes (build/test only) | |
tags: [ 'v*' ] # run on version tags (full release) | |
permissions: | |
contents: write # needed to create GitHub Releases | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
cache: npm | |
- name: Install | |
run: npm ci | |
- name: Test | |
run: npm test | |
- name: Build | |
run: npm run build | |
# Only publish to npm on version tags (refs/tags/vX.Y.Z) | |
- name: Publish to npm | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --access public | |
# Only create a GitHub Release on version tags | |
- name: Create GitHub Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true |