Skip to content

Commit 067a5cd

Browse files
authored
chore: add changesets action to automate version and publish (#582)
1 parent 6931551 commit 067a5cd

8 files changed

+58
-122
lines changed

.github/workflows/publish_npm_agentkit_langchain.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/publish_npm_agentkit_model_context_protocol.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/publish_npm_agentkit_vercel_ai_sdk.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/publish_npm_create_onchain_agent.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/publish_npm_agentkit.yml renamed to .github/workflows/publish_npm_manual.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
name: Publish AgentKit to NPM
1+
name: Publish Package to NPM
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
directory:
7+
description: "Directory within the 'typescript' folder containing the package to publish (e.g., agentkit)"
8+
required: true
9+
type: string
10+
default: "agentkit"
511

612
jobs:
7-
deploy-npm-agentkit:
13+
deploy-npm-package:
814
runs-on: ubuntu-latest
915
permissions:
1016
contents: read
@@ -17,8 +23,8 @@ jobs:
1723
registry-url: "https://registry.npmjs.org"
1824
cache: "npm"
1925
cache-dependency-path: ./typescript
20-
- name: Install, build and publish @coinbase/agentkit
21-
working-directory: ./typescript/agentkit
26+
- name: Install, build and publish package
27+
working-directory: ./typescript/${{ inputs.directory }}
2228
run: |
2329
npm ci
2430
npm run build
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Version and Publish NPM
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
11+
jobs:
12+
version-and-publish:
13+
name: Version and Publish
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Clone repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "18"
23+
registry-url: "https://registry.npmjs.org"
24+
cache: "npm"
25+
cache-dependency-path: ./typescript
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
working-directory: ./typescript
30+
31+
- name: Version and/or Publish to NPM
32+
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc
33+
with:
34+
commit: "chore: version packages"
35+
title: "chore: version packages"
36+
version: npm run changeset:version
37+
publish: npm run publish
38+
cwd: ./typescript
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING-TYPESCRIPT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Changesets are stored in the `.changeset` directory. Each changeset is stored as
276276
To add a changeset, use `changesets` to create it for you:
277277

278278
```bash
279-
npx @changesets/cli
279+
npm run changeset
280280
```
281281

282282
This will kick off an interactive prompt to help you create the changeset. Use the arrow keys to navigate the different options, and press the `Space` key to select an option. You should select the package(s) you are making a change to – most of the time this will be `@coinbase/agentkit`. Once selected, hit `Enter`. You'll then be prompted to specify the type of change you are making (major, minor or patch), starting with major. Most of the time you will not be making a major change, so hitting `Enter` will progress to the next step. If you're adding a new feature, you should select `minor`. If you're fixing a bug, you should select `patch`. Once selected, you will be prompted to provide a summary of your changes. This should be a short, specific description in the past tense (see above for examples).

typescript/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"packageManager": "[email protected]",
2222
"scripts": {
2323
"build": "turbo run build",
24+
"changeset": "changeset",
25+
"changeset:publish": "npm ci && npm run build && changeset publish",
26+
"changeset:version": "changeset version",
2427
"test": "turbo run test",
2528
"lint": "turbo run lint",
2629
"clean": "turbo run clean",
@@ -34,6 +37,9 @@
3437
"author": "Coinbase Inc.",
3538
"license": "Apache-2.0",
3639
"repository": "https://github.com/coinbase/agentkit",
40+
"publishConfig": {
41+
"provenance": true
42+
},
3743
"keywords": [
3844
"coinbase",
3945
"sdk",

0 commit comments

Comments
 (0)