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
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Release

on:
push:
tags:
- "v*.*.*"
- "v*.*.*-alpha.*"
- "v*.*.*-beta.*"

permissions:
contents: read
id-token: write # Required for npm provenance

env:
NODE_VERSION: "22.x"

jobs:
verify-version:
name: Verify version
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version from tag
id: tag
run: |
TAG=${GITHUB_REF#refs/tags/v}
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "Tagged version: $TAG"

- name: Read package.json version
id: package
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Package version: $VERSION"

- name: Compare versions
run: |
if [ "${{ steps.tag.outputs.version }}" != "${{ steps.package.outputs.version }}" ]; then
echo "ERROR: Tag version (${{ steps.tag.outputs.version }}) does not match package.json version (${{ steps.package.outputs.version }})"
exit 1
fi
echo "Versions match: ${{ steps.tag.outputs.version }}"

publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: verify-version
environment:
name: npm
url: https://www.npmjs.com/package/@ampersend_ai/clawrouter-core

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: package.json

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml

- name: Update npm
run: npm install -g npm@latest

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

- name: Build package
run: pnpm build

- name: Determine publish tag
id: publish-tag
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
if [[ "$VERSION" == *"-alpha."* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
echo "Publishing with tag: alpha"
elif [[ "$VERSION" == *"-beta."* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
echo "Publishing with tag: beta"
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "Publishing with tag: latest"
fi

- name: Publish to npm
run: npm publish --access public --tag ${{ steps.publish-tag.outputs.tag }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blockrun/clawrouter",
"name": "@ampersend_ai/clawrouter-core",
"version": "0.10.6",
"description": "Smart LLM router — save 92% on inference costs. 41+ models, one wallet, x402 micropayments.",
"type": "module",
Expand Down Expand Up @@ -65,7 +65,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/BlockRunAI/ClawRouter.git"
"url": "git+https://github.com/edgeandnode/ClawRouter.git"
},
"dependencies": {
"viem": "^2.39.3"
Expand Down
Loading