Skip to content

v3.1.1

v3.1.1 #20

Workflow file for this run

# IMPORTANT: DO NOT RENAME THIS FILE
# It uses Trusted Publisher to deploy without token
# https://www.npmjs.com/package/ai-stream-utils/access
name: Release
on:
release:
types: [published]
workflow_dispatch:
permissions:
id-token: write # needed for npm publish with provenance
contents: write # needed to force-push the floating major version tag
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
# http://github.com/actions/checkout
- uses: actions/checkout@v5
# https://github.com/pnpm/action-setup
- uses: pnpm/action-setup@v4
# https://github.com/actions/setup-node
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- run: pnpm test
# This is the current major line, so it publishes to `latest`. The 2.x
# maintenance line publishes from the `v2` branch's own release.yml (under
# the `ai-v6` dist-tag) and never reaches this file.
- name: Publish to npm (latest)
run: pnpm publish --provenance --no-git-checks
# Move the floating major tag (e.g. v3.x) onto this release commit so
# version-pinned links like /tree/v3.x always resolve to the newest
# release in that major line. Pushed with the default GITHUB_TOKEN, whose
# pushes do not re-trigger workflows (no CI loop). Gated to `release`
# because workflow_dispatch has no release payload -> empty TAG -> would
# create a broken ".x" tag.
- name: Update major version tag
if: ${{ github.event_name == 'release' }}
env:
TAG: ${{ github.event.release.tag_name }} # e.g. v3.0.0
run: |
major="${TAG%%.*}" # v3.0.0 -> v3
git tag -f "${major}.x" # tag the checked-out release commit -> v3.x
git push -f origin "${major}.x"