Skip to content

ci: github action as trusted publisher removes token #39

ci: github action as trusted publisher removes token

ci: github action as trusted publisher removes token #39

Workflow file for this run

name: Release
permissions:
id-token: write
contents: read
on:
workflow_dispatch: ~
push:
tags:
- "v*"
jobs:
release:
name: Create and publish a release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check formatting
run: pnpm format:check
- name: Lint
run: pnpm lint
- name: Run tests
run: pnpm test
- name: Build
run: pnpm build
- name: Publish to npm
run: |
node -e "const p=require('./package.json'); delete p.packageManager; require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2))"
npm publish --provenance --access public