Skip to content

Commit 037cccd

Browse files
committed
feat: Establish CI/CD for JS SDK and CLI publishing, remove Python release workflow, and introduce createClient with documentation for both packages.
1 parent 9be9dc4 commit 037cccd

12 files changed

Lines changed: 1482 additions & 844 deletions

File tree

.github/workflows/publish-cli.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish CLI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to publish (leave empty to use package.json version)"
8+
required: false
9+
type: string
10+
dry-run:
11+
description: "Dry run (skip actual publish)"
12+
required: false
13+
type: boolean
14+
default: false
15+
16+
permissions:
17+
contents: read
18+
id-token: write # required for npm provenance
19+
20+
defaults:
21+
run:
22+
working-directory: .
23+
24+
jobs:
25+
publish-cli:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "22"
35+
registry-url: "https://registry.npmjs.org"
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Build SDK (dependency)
41+
run: npm run build --workspace=packages/sdk
42+
43+
- name: Build CLI
44+
run: npm run build --workspace=packages/cli
45+
46+
- name: Run tests
47+
run: npm test --workspace=packages/cli
48+
49+
- name: Set version (if provided)
50+
if: ${{ inputs.version != '' }}
51+
working-directory: packages/cli
52+
run: npm version "${{ inputs.version }}" --no-git-tag-version
53+
54+
- name: Read version
55+
id: version
56+
working-directory: packages/cli
57+
run: echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
58+
59+
- name: Publish to npm
60+
if: ${{ !inputs.dry-run }}
61+
working-directory: packages/cli
62+
run: npm publish --provenance --access public
63+
env:
64+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
65+
66+
- name: Publish (dry run)
67+
if: ${{ inputs.dry-run }}
68+
working-directory: packages/cli
69+
run: npm publish --dry-run
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
73+
- name: Summary
74+
run: |
75+
echo "## 📦 @pixelml/agenticflow-cli@${{ steps.version.outputs.version }}" >> "$GITHUB_STEP_SUMMARY"
76+
if [ "${{ inputs.dry-run }}" = "true" ]; then
77+
echo "🏃 **Dry run** — nothing was published" >> "$GITHUB_STEP_SUMMARY"
78+
else
79+
echo "✅ Published to [npm](https://www.npmjs.com/package/@pixelml/agenticflow-cli/v/${{ steps.version.outputs.version }})" >> "$GITHUB_STEP_SUMMARY"
80+
fi

.github/workflows/publish-sdk.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish SDK
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to publish (leave empty to use package.json version)"
8+
required: false
9+
type: string
10+
dry-run:
11+
description: "Dry run (skip actual publish)"
12+
required: false
13+
type: boolean
14+
default: false
15+
16+
permissions:
17+
contents: read
18+
id-token: write # required for npm provenance
19+
20+
defaults:
21+
run:
22+
working-directory: .
23+
24+
jobs:
25+
publish-sdk:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "22"
35+
registry-url: "https://registry.npmjs.org"
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Build SDK
41+
run: npm run build --workspace=packages/sdk
42+
43+
- name: Run tests
44+
run: npm test --workspace=packages/sdk
45+
46+
- name: Set version (if provided)
47+
if: ${{ inputs.version != '' }}
48+
working-directory: packages/sdk
49+
run: npm version "${{ inputs.version }}" --no-git-tag-version
50+
51+
- name: Read version
52+
id: version
53+
working-directory: packages/sdk
54+
run: echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
55+
56+
- name: Publish to npm
57+
if: ${{ !inputs.dry-run }}
58+
working-directory: packages/sdk
59+
run: npm publish --provenance --access public
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
63+
- name: Publish (dry run)
64+
if: ${{ inputs.dry-run }}
65+
working-directory: packages/sdk
66+
run: npm publish --dry-run
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
70+
- name: Summary
71+
run: |
72+
echo "## 📦 @pixelml/agenticflow-sdk@${{ steps.version.outputs.version }}" >> "$GITHUB_STEP_SUMMARY"
73+
if [ "${{ inputs.dry-run }}" = "true" ]; then
74+
echo "🏃 **Dry run** — nothing was published" >> "$GITHUB_STEP_SUMMARY"
75+
else
76+
echo "✅ Published to [npm](https://www.npmjs.com/package/@pixelml/agenticflow-sdk/v/${{ steps.version.outputs.version }})" >> "$GITHUB_STEP_SUMMARY"
77+
fi

.github/workflows/release-python.yaml

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

0 commit comments

Comments
 (0)