Skip to content

Fix set-output deprecation. #31

Fix set-output deprecation.

Fix set-output deprecation. #31

Workflow file for this run

name: Release NPM package
on:
push:
tags: ['v*']
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Node build
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-npm-${{ hashFiles('**/package-lock.lock') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run build
- run: npm test
release:
needs: [build]
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-npm-${{ hashFiles('**/package-lock.lock') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Set tag
id: tagName
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- run: npm ci
- run: npm run build
- run: npm publish