v4.0.0 #2
Workflow file for this run
This file contains 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: Publish release | |
on: | |
# Runs whenever a new release is created in GitHub | |
release: | |
types: [ created ] | |
jobs: | |
# Publish job | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
strategy: | |
matrix: | |
node-version: [ 20 ] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.target_commitish }} | |
- name: Validate and extract release information | |
id: release | |
uses: manovotny/github-releases-for-automated-package-publishing-action@v2.0.1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
always-auth: true | |
cache: 'npm' | |
- run: npm ci | |
- name: Publish latest version | |
if: steps.release.outputs.tag == '' | |
run: npm publish --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish next version | |
if: steps.release.outputs.tag != '' | |
run: npm publish --provenance --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |