Skip to content

v2.1.2

v2.1.2 #31

Workflow file for this run

name: Publish
on:
release:
types: [created]
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6.3.0
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: install
run: yarn install
- name: Update package.json version to match tag
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/}"
# Remove leading 'v' if present in tag
if [[ "$TAG_VERSION" == v* ]]; then
TAG_VERSION="${TAG_VERSION:1}"
fi
node -e "
const fs = require('fs');
const pkg = require('./package.json');
pkg.version = process.env.TAG_VERSION;
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
"
env:
TAG_VERSION: ${{ github.ref_name }}
- name: publish
run: npm publish