Skip to content

Commit

Permalink
Fixed GH actions (added npm ci on root directory first)
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-cb committed Dec 3, 2024
1 parent e9759db commit 6cea218
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on: [pull_request]

jobs:
lint-agentkit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
# Install dependencies in parent directory first
- run: npm ci
# Then install and lint in working directory
- name: Install and lint agentkit
working-directory: ./cdp-agentkit-core
run: |
npm ci
npm run lint
npm run format
lint-langchain:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
# Install dependencies in parent directory first
- run: npm ci
# Then install and lint in working directory
- name: Install and lint langchain
working-directory: ./cdp-langchain
run: |
npm ci
npm run lint
npm run format
28 changes: 28 additions & 0 deletions .github/workflows/publish_agentkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release AgentKit Core to NPM

on:
workflow_dispatch:

jobs:
deploy-agentkit:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
# Install dependencies in parent directory first
- run: npm ci
# Then install, build and publish in working directory
- name: Install, build and publish agentkit
working-directory: ./cdp-agentkit-core
run: |
npm ci
npm run build
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Docs to Github Pages

on:
workflow_dispatch:

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"

# Install dependencies in parent directory first
- run: npm ci

# Build cdp-agentkit-core docs
- name: Build AgentKit Core docs
run: |
cd cdp-agentkit-core
npm ci
npm run docs
cd ..
mkdir -p docs/cdp-agentkit-core
cp -r cdp-agentkit-core/docs/* docs/cdp-agentkit-core/
# Build cdp-langchain docs
- name: Build LangChain docs
run: |
cd cdp-langchain
npm ci
npm run docs
cd ..
mkdir -p docs/cdp-langchain
cp -r cdp-langchain/docs/* docs/cdp-langchain/
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: false
28 changes: 28 additions & 0 deletions .github/workflows/publish_langchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish LangChain to NPM

on:
workflow_dispatch:

jobs:
deploy-langchain:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
# Install dependencies in parent directory first
- run: npm ci
# Then install, build and publish in working directory
- name: Install, build and publish langchain
working-directory: ./cdp-langchain
run: |
npm ci
npm run build
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Unit Tests

on: [pull_request]

jobs:
test-agentkit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18", "20"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# Install dependencies in parent directory first
- run: npm ci
# Then install and test in working directory
- name: Install and test agentkit
working-directory: ./cdp-agentkit-core
run: |
npm ci
npm run test:unit
test-langchain:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18", "20"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# Install dependencies in parent directory first
- run: npm ci
# Then install and test in working directory
- name: Install and test langchain
working-directory: ./cdp-langchain
run: |
npm ci
npm run test:unit
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CDP Agentkit.js
# CDP Agentkit Node.js SDK

[![npm downloads](https://img.shields.io/npm/dm/@coinbase/cdp-agentkit-core?style=flat-square)](https://www.npmjs.com/package/@coinbase/cdp-agentkit-core)
[![GitHub star chart](https://img.shields.io/github/stars/coinbase/cdp-agentkit-nodejs?style=flat-square)](https://star-history.com/#coinbase/cdp-agentkit-nodejs)
Expand Down Expand Up @@ -48,4 +48,4 @@ See [SECURITY.md](SECURITY.md) for more information.
## Documentation
- [CDP Agentkit Documentation](https://docs.cdp.coinbase.com/agentkit/docs/welcome)
- [API Reference: CDP Agentkit Core](https://coinbase.github.io/cdp-agentkit-nodejs/cdp-agentkit-core/index.html)
- [API Reference: CDP Agentkit LangChain Extension](https://coinbase.github.io/cdp-agentkit-nodejs/cdp-langchain/index.html)
- [API Reference: CDP Agentkit LangChain Extension](https://coinbase.github.io/cdp-agentkit-nodejs/cdp-langchain/index.html)

0 comments on commit 6cea218

Please sign in to comment.