34 lines
861 B
YAML
34 lines
861 B
YAML
name: Publish and Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
- '!v*.*.*-beta.*'
|
|
|
|
jobs:
|
|
publish-npm:
|
|
name: Publish to npm
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
# Setup .npmrc file to publish to npm
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
|
|
with:
|
|
node-version: "lts/*"
|
|
registry-url: "https://registry.npmjs.org"
|
|
- name: Update npm
|
|
run: npm install -g npm@latest
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|