Skip to content

Commit

Permalink
Update contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-agarwal-coinbase authored and John-peterson-coinbase committed Jan 15, 2025
1 parent 3132379 commit e53fa14
Show file tree
Hide file tree
Showing 17 changed files with 630 additions and 100 deletions.
74 changes: 62 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Lint
on: [pull_request]

jobs:
lint-agentkit:
lint-cdp-agentkit-core-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-agentkit-core
working-directory: ./cdp-agentkit-core/python
steps:
- uses: actions/checkout@v3

Expand All @@ -26,8 +26,8 @@ jobs:
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ./cdp-agentkit-core/.venv
key: venv-agentkit-${{ runner.os }}-${{ hashFiles('cdp-agentkit-core/poetry.lock') }}
path: ./cdp-agentkit-core/python/.venv
key: venv-agentkit-${{ runner.os }}-${{ hashFiles('cdp-agentkit-core/python/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand All @@ -36,11 +36,11 @@ jobs:
- name: Run linters
run: poetry run make lint

lint-langchain:
lint-cdp-langchain-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-langchain
working-directory: ./cdp-langchain/python
steps:
- uses: actions/checkout@v3

Expand All @@ -60,8 +60,8 @@ jobs:
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ./cdp-langchain/.venv
key: venv-langchain-${{ runner.os }}-${{ hashFiles('cdp-langchain/poetry.lock') }}
path: ./cdp-langchain/python/.venv
key: venv-langchain-${{ runner.os }}-${{ hashFiles('cdp-langchain/python/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand All @@ -70,11 +70,11 @@ jobs:
- name: Run linters
run: poetry run make lint

lint-twitter-langchain:
lint-twitter-langchain-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./twitter-langchain
working-directory: ./twitter-langchain/python
steps:
- uses: actions/checkout@v3

Expand All @@ -94,12 +94,62 @@ jobs:
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ./twitter-langchain/.venv
key: venv-twitter-langchain-${{ runner.os }}-${{ hashFiles('twitter-langchain/poetry.lock') }}
path: ./twitter-langchain/python/.venv
key: venv-twitter-langchain-${{ runner.os }}-${{ hashFiles('twitter-langchain/python/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev

- name: Run linters
run: poetry run make lint

lint-cdp-agentkit-core-typescript:
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 install
# Then install and lint in working directory
- name: Install and lint @coinbase/cdp-agentkit-core
working-directory: ./cdp-agentkit-core/typescript
run: |
npm install
npm run lint
npm run format
lint-cdp-langchain-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- run: npm install
- name: Install and lint @coinbase/cdp-langchain
working-directory: ./cdp-langchain/typescript
run: |
npm install
npm run lint
npm run format
lint-twitter-langchain-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- run: npm install
- name: Install and lint @coinbase/twitter-langchain
working-directory: ./twitter-langchain/typescript
run: |
npm install
npm run lint
npm run format
85 changes: 54 additions & 31 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Node 18
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"

- name: Install and Build JSDocs
run: |
npm i
npm run build
npm run docs
- name: Build CDP AgentKit Core JSDocs
run: |
mkdir -p docs/cdp-agentkit-core/typescript
cp -r cdp-agentkit-core/typescript/docs/* docs/cdp-agentkit-core/typescript
- name: Build CDP LangChain JSDocs
run: |
mkdir -p docs/cdp-langchain/typescript
cp -r cdp-langchain/typescript/docs/* docs/cdp-langchain/typescript
- name: Build Twitter LangChain JSDocs
run: |
mkdir -p docs/twitter-langchain/typescript
cp -r twitter-langchain/typescript/docs/* docs/twitter-langchain/typescript
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
Expand All @@ -21,82 +48,78 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

# cdp-agentkit-core
- name: Load cached venv for cdp-agentkit-core
- name: Load cached venv for CDP AgentKit Core Python
id: cached-poetry-dependencies-core
uses: actions/cache@v3
with:
path: ./cdp-agentkit-core/.venv
key: venv-agentkit-${{ runner.os }}-3.10-${{ hashFiles('cdp-agentkit-core/poetry.lock') }}
path: ./cdp-agentkit-core/python/.venv
key: venv-agentkit-${{ runner.os }}-3.10-${{ hashFiles('cdp-agentkit-core/python/poetry.lock') }}

- name: Install dependencies for cdp-agentkit-core
- name: Install dependencies for CDP AgentKit Core Python
if: steps.cached-poetry-dependencies-core.outputs.cache-hit != 'true'
run: |
cd cdp-agentkit-core
cd cdp-agentkit-core/python
poetry install --with dev
cd ..
- name: Build Sphinx Documentation for cdp-agentkit-core
- name: Build Sphinx Documentation for CDP AgentKit Core Python
run: |
cd cdp-agentkit-core
cd cdp-agentkit-core/python
poetry run make docs
cd docs
poetry run make html
cd ../..
mkdir -p docs/cdp-agentkit-core
cp -r cdp-agentkit-core/docs/_build/html/* docs/cdp-agentkit-core
mkdir -p docs/cdp-agentkit-core/python
cp -r cdp-agentkit-core/python/docs/_build/html/* docs/cdp-agentkit-core/python
# cdp-langchain
- name: Load cached venv for cdp-langchain
- name: Load cached venv for CDP LangChain Python
id: cached-poetry-dependencies-langchain
uses: actions/cache@v3
with:
path: ./cdp-langchain/.venv
key: venv-langchain-${{ runner.os }}-3.10-${{ hashFiles('cdp-langchain/poetry.lock') }}
path: ./cdp-langchain/python/.venv
key: venv-langchain-${{ runner.os }}-3.10-${{ hashFiles('cdp-langchain/python/poetry.lock') }}

- name: Install dependencies for cdp-langchain
- name: Install dependencies for CDP LangChain Python
if: steps.cached-poetry-dependencies-langchain.outputs.cache-hit != 'true'
run: |
cd cdp-langchain
cd cdp-langchain/python
poetry install --with dev
cd ..
- name: Build Sphinx Documentation for cdp-langchain
- name: Build Sphinx Documentation for CDP LangChain Python
run: |
cd cdp-langchain
cd cdp-langchain/python
poetry run make docs
cd docs
poetry run make html
cd ../..
mkdir -p docs/cdp-langchain
cp -r cdp-langchain/docs/_build/html/* docs/cdp-langchain
mkdir -p docs/cdp-langchain/python
cp -r cdp-langchain/python/docs/_build/html/* docs/cdp-langchain/python
# twitter-langchain
- name: Load cached venv for twitter-langchain
- name: Load cached venv for Twitter LangChain Python
id: cached-poetry-dependencies-twitter-langchain
uses: actions/cache@v3
with:
path: ./twitter-langchain/.venv
key: venv-twitter-langchain-${{ runner.os }}-3.10-${{ hashFiles('twitter-langchain/poetry.lock') }}
path: ./twitter-langchain/python/.venv
key: venv-twitter-langchain-${{ runner.os }}-3.10-${{ hashFiles('twitter-langchain/python/poetry.lock') }}

- name: Install dependencies for twitter-langchain
- name: Install dependencies for Twitter LangChain Python
if: steps.cached-poetry-dependencies-twitter-langchain.outputs.cache-hit != 'true'
run: |
cd twitter-langchain
cd twitter-langchain/python
poetry install --with dev
cd ..
- name: Build Sphinx Documentation for twitter-langchain
- name: Build Sphinx Documentation for Twitter LangChain Python
run: |
cd twitter-langchain
cd twitter-langchain/python
poetry run make docs
cd docs
poetry run make html
cd ../..
mkdir -p docs/twitter-langchain
cp -r twitter-langchain/docs/_build/html/* docs/twitter-langchain
mkdir -p docs/twitter-langchain/python
cp -r twitter-langchain/python/docs/_build/html/* docs/twitter-langchain/python
# deploy
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish_npm_cdp_agentkit_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release CDP AgentKit Core to NPM

on:
workflow_dispatch:

jobs:
deploy-npm-cdp-agentkit-core:
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"
- run: npm ci
- name: Install, build and publish @coinbase/cdp-agentkit-core
working-directory: ./cdp-agentkit-core/typescript
run: |
npm ci
npm run build
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/publish_npm_cdp_langchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish CDP LangChain to NPM

on:
workflow_dispatch:

jobs:
deploy-npm-cdp-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"
- run: npm i && npm run build
- name: Install, build and publish @coinbase/cdp-langchain
working-directory: ./cdp-langchain/typescript
run: |
npm publish --ignore-scripts --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/publish_npm_twitter_langchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Twitter LangChain to NPM

on:
workflow_dispatch:

jobs:
deploy-npm-twitter-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"
- run: npm i && npm run build
- name: Install, build and publish @coinbase/twitter-langchain
working-directory: ./twitter-langchain/typescript
run: |
npm publish --ignore-scripts --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Release AgentKit to PyPI
name: Release CDP AgentKit Core to PyPI

on:
workflow_dispatch:

jobs:
deploy-agentkit:
deploy-pypi-cdp-agentkit-core:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-agentkit-core
working-directory: ./cdp-agentkit-core/python
environment:
name: pypi
url: https://pypi.org/p/cdp-agentkit-core
Expand Down Expand Up @@ -41,4 +41,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: cdp-agentkit-core/dist/
packages-dir: cdp-agentkit-core/python/dist/
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Release LangChain to PyPI
name: Release CDP LangChain to PyPI

on:
workflow_dispatch:

jobs:
deploy-langchain:
deploy-pypi-cdp-langchain:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-langchain
working-directory: ./cdp-langchain/python
environment:
name: pypi
url: https://pypi.org/p/cdp-langchain
Expand Down Expand Up @@ -41,4 +41,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: cdp-langchain/dist/
packages-dir: cdp-langchain/python/dist/
Loading

0 comments on commit e53fa14

Please sign in to comment.