Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Bump version to 2.3.3 and update release workflow to use npm trusted … #18

Bump version to 2.3.3 and update release workflow to use npm trusted …

Bump version to 2.3.3 and update release workflow to use npm trusted … #18

name: Tag, Release, and Publish on Push
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.27.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Read version from package.json
id: get_version
run: |
version=$(node -p "require('./package.json').version")
echo "version=v$version" >> $GITHUB_OUTPUT
- name: Check if tag already exists
run: |
if git rev-parse ${{ steps.get_version.outputs.version }} >/dev/null 2>&1; then
echo "::error::Tag ${{ steps.get_version.outputs.version }} already exists. Did you forget to bump the version in package.json?"
exit 1
fi
- name: Create Git tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag ${{ steps.get_version.outputs.version }}
git push origin ${{ steps.get_version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get_version.outputs.version }}
name: Release ${{ steps.get_version.outputs.version }}
body: Automated release for version ${{ steps.get_version.outputs.version }}.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
run: pnpm publish --access public --provenance