Skip to content

v1.1.2

v1.1.2 #8

Workflow file for this run

name: Publish to npm on release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: npm
- name: Sync package.json version from release tag
if: github.event_name == 'release'
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
echo "Setting package.json version to $VERSION (from tag $TAG)"
npm version "$VERSION" --no-git-tag-version --allow-same-version
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Commit version bump
if: github.event_name == 'release'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git diff --staged --quiet || git commit -m "chore: bump version to ${{ github.event.release.tag_name }}"
git push origin HEAD:main
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --provenance