Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lerna an npm #428

Merged
merged 4 commits into from
Nov 20, 2024
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
71 changes: 71 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
workflow_dispatch:
inputs:
release_type:
description: "Type of release (prerelease, prepatch, patch, minor, preminor, major)"
required: true
default: "patch"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"

- name: "Setup npm for npmjs"
run: |
npm config set registry https://registry.npmjs.org/
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install Protobuf Compiler
run: sudo apt-get install -y protobuf-compiler

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm run build

- name: Tag and Publish Packages
id: tag_publish
run: |
npx lerna version ${{ github.event.inputs.release_type }} --conventional-commits --yes --no-private --force-publish
npx lerna publish from-git --yes --dist-tag ${{ github.event.inputs.release_type == 'preminor' && 'next' || 'latest' }}

- name: Get Version Tag
id: get_tag
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT

- name: Generate Release Body
id: release_body
run: |
if [ -f CHANGELOG.md ]; then
echo "body=$(cat CHANGELOG.md)" >> $GITHUB_OUTPUT
else
echo "body=No changelog provided for this release." >> $GITHUB_OUTPUT
fi

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
with:
tag_name: ${{ steps.get_tag.outputs.TAG }}
release_name: Release
body_path: CHANGELOG.md
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sh scripts/start.sh

### Edit the character file

1. Open `packages/agent/src/character.ts` to modify the default character. Uncomment and edit.
1. Open `agent/src/character.ts` to modify the default character. Uncomment and edit.

2. To load custom characters:
- Use `pnpm start --characters="path/to/your/character.json"`
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/agent/tsconfig.json → agent/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
Expand Down
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "0.1.0",
"packages": ["packages/*"],
"npmClient": "pnpm"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint": "pnpm --dir packages/core lint && pnpm --dir packages/agent lint",
"prettier-check": "npx prettier --check .",
"prettier": "npx prettier --write .",
"release": "pnpm build && pnpm prettier && npx lerna publish --no-private --force-publish",
"clean": "bash ./scripts/clean.sh",
"docker:build": "bash ./scripts/docker.sh build",
"docker:run": "bash ./scripts/docker.sh run",
Expand Down
6 changes: 6 additions & 0 deletions packages/adapter-postgres/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/adapter-sqlite/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/adapter-sqljs/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/adapter-supabase/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/client-auto/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/client-direct/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/client-discord/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/client-telegram/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/client-twitter/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-bootstrap/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-image-generation/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-node/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-solana/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-starknet/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 6 additions & 0 deletions packages/plugin-trustdb/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 5 additions & 1 deletion packages/plugin-trustdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
"@ai16z/eliza": "workspace:*",
"tsup": "^8.3.5",
"uuid": "11.0.2",
"vitest": "^2.1.4"
"vitest": "^2.1.4",
"dompurify": "3.2.0"
},
"scripts": {
"build": "tsup --format esm --dts",
"test": "vitest"
},
"devDependencies": {
"@types/dompurify": "^3.2.0"
},
"peerDependencies": {
"whatwg-url": "7.1.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-video-generation/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
Loading