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
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ on:
pull_request:
branches: [main]

env:
TURBO_TELEMETRY_DISABLED: '1'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v4

Expand All @@ -26,6 +31,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v4

Expand All @@ -43,6 +50,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v4

Expand All @@ -60,6 +69,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v4

Expand Down
53 changes: 26 additions & 27 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ on:
description: >
Release mode:
- "version" — Creates a "Version Packages" PR that bumps versions and
updates CHANGELOG.md based on pending changesets. Run this first.
- "publish" — Publishes the package to npm with provenance. Only run
this AFTER the Version Packages PR has been merged to main.
updates each package's CHANGELOG.md based on pending changesets. Run
this first.
- "publish" — Publishes every package whose on-disk version differs
from npm, with provenance. Only run this AFTER the Version Packages
PR has been merged to main.
NOTE: @openrouter/agent releases must be coordinated with @openrouter/sdk
because callModel changes are typically coupled with SDK type changes.
required: true
Expand All @@ -23,8 +25,8 @@ on:
default: version
dry-run:
description: >
Dry run: If enabled, simulates the release without making any changes.
Useful for verifying what would happen before committing to a release.
Dry run: If enabled, simulates the publish without making any changes.
Useful for verifying what would publish before committing to a release.
required: false
type: boolean
default: false
Expand All @@ -34,6 +36,9 @@ permissions:
pull-requests: write # For creating/updating the Version Packages PR
id-token: write # For npm provenance signing

env:
TURBO_TELEMETRY_DISABLED: '1'

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -55,39 +60,33 @@ jobs:

- run: pnpm run test

- name: Check for pending changesets
if: github.event_name == 'push'
id: changesets
run: |
if ls .changeset/*.md 1>/dev/null 2>&1; then
echo "pending=true" >> "$GITHUB_OUTPUT"
else
echo "pending=false" >> "$GITHUB_OUTPUT"
fi

- name: Create Version Packages PR
- name: Version PR or Publish (changesets)
if: >
(github.event_name == 'push' && steps.changesets.outputs.pending == 'true') ||
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.mode == 'version')
Comment thread
mattapperson marked this conversation as resolved.
uses: changesets/action@v1
with:
title: "chore: version packages"
commit: "chore: version packages"
publish: pnpm publish --no-git-checks --provenance --access public
title: 'chore: version packages'
commit: 'chore: version packages'
version: pnpm exec changeset version
publish: pnpm exec changeset publish --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm
if: >
(github.event_name == 'push' && steps.changesets.outputs.pending == 'false') ||
(github.event_name == 'workflow_dispatch' && inputs.mode == 'publish' && !inputs.dry-run)
run: pnpm publish --no-git-checks --provenance --access public
- name: Publish (workflow_dispatch, live)
if: github.event_name == 'workflow_dispatch' && inputs.mode == 'publish' && !inputs.dry-run
run: pnpm exec changeset publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm (dry run)
# `changeset publish` has no native --dry-run. Fall back to pnpm's
# recursive dry-run, which simulates publishing every workspace package
# rather than only the ones changesets would pick. Output set may be
# wider than the live publish — but nothing is actually published, so
# this is only a diagnostic preview.
- name: Publish (workflow_dispatch, dry-run)
if: github.event_name == 'workflow_dispatch' && inputs.mode == 'publish' && inputs.dry-run
run: pnpm publish --no-git-checks --provenance --access public --dry-run
run: pnpm -r publish --dry-run --access public --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
esm/
node_modules/
.eslintcache
.worktrees/
.worktrees/
.turbo/
.env
.env.*
!.env.example
Loading
Loading