Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags: ["v*"]
workflow_dispatch:

permissions:
contents: read
# Required for npm trusted publishing (OIDC).
id-token: write

jobs:
publish:
# Trusted publishing requires a GitHub-hosted runner.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
registry-url: https://registry.npmjs.org

# Trusted publishing needs npm >= 11.5.1.
- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Verify tag matches package.json version
if: github.ref_type == 'tag'
run: |
pkg="$(node -p "require('./package.json').version")"
tag="${GITHUB_REF_NAME#v}"
if [ "$pkg" != "$tag" ]; then
echo "Tag v$tag does not match package.json version $pkg" >&2
exit 1
fi

# Publishes via npm trusted publishing (OIDC) — the trusted publisher
# for this package on npmjs.com points at this workflow file, so no
# token is needed. Provenance is generated automatically.
# prepublishOnly runs typecheck, tests, build, and package checks.
- name: Publish to npm
run: npm publish --access public
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stringent",
"version": "0.1.0",
"version": "0.0.5",
"description": "A smart and type-safe expression parser with compile-time validation, inference and runtime evaluation",
"keywords": [
"parser",
Expand Down
Loading