Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

v3.1.0-beta.6

v3.1.0-beta.6 #34

Workflow file for this run

name: publish_npm_release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
# Specify the environment to use its secrets
environment:
name: main # Replace with the actual environment name
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Check release tag
run: |
VERSION=$(node -p "const ver=require('./package.json').version; ver.startsWith('v') ? ver : 'v' + ver")
TAG=${{ github.ref }}
TAG=${TAG#refs/tags/}
if [ "$VERSION" != "$TAG" ]; then
echo "Error: The release tag ($TAG) does not match the version ($VERSION) in package.json"
exit 1
fi
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run build --if-present
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}