Skip to content

Commit 8a0f8a9

Browse files
authored
feat: marketplace support (#249)
* chore: remove workspaces for each single tools * chore: remove workspaces for each single tools * chore: remove workspaces for each single tools * chore: remove workspaces for each single tools * chore: add locks to all tools * chore: add remove-empty-tools.ts script * chore: tool init * fix: tsc * chore: change all @type/bun latest * chore: build all tools, generate bun.lock for each tool * chore: update new tool script template * chore: build to marketplace-importable json * chore: build runtime dockerfile * chore: upload assets files to s3 * chore: sdk types * fix: dev when sprase-checkout * chore: confirmUpload can confirm a bunch of tools * chore: dev tool list parentId * feat: install directly * fix: type * chore: deploy marketplace script * fix: external s3 ak/sk * fix: delete tools; init tools clean the dir * fix: install * chore: github action deploy marketplace data script * feat: run tool openapi doc * fix: some logos * chore: sparse-checkout * fix: only load active plugins * feat: support auto delete plugin inactivated in 10mins * perf: tool install logic * fix: somebug * fix: dev tool filename * fix: dev tool children icon * chore: dev contentType * fix: race condition for init tools * fix: dev icon * chore: adjust * fix: fix minioKey * chore: sdk publish 0.2.0 * fix: children icon
1 parent 1405587 commit 8a0f8a9

File tree

275 files changed

+5693
-3278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+5693
-3278
lines changed

.env.deploy.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
S3_ENDPOINT=http://localhost:9000
2+
S3_BUCKET=fastgpt-plugins
3+
S3_ACCESS_KEY=minioadmin
4+
S3_SECRET_KEY=minioadmin

.github/workflows/build-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v4
25+
with:
26+
sparse-checkout: |
27+
/*
28+
!modules/tool/packages
2529
- name: Set up Docker Buildx
2630
uses: docker/setup-buildx-action@v3
2731

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy to Marketplace
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
inputs:
8+
environment:
9+
description: 'Deployment environment'
10+
required: true
11+
default: 'production'
12+
type: choice
13+
options:
14+
- production
15+
- staging
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v1
27+
with:
28+
bun-version: 1.2.23
29+
30+
- name: Install root dependencies
31+
run: bun install --frozen-lockfile
32+
33+
- name: Install tool package dependencies
34+
run: bun run ./scripts/install-all.ts
35+
36+
- name: Build and deploy to marketplace
37+
env:
38+
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
39+
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
40+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
41+
S3_BUCKET: ${{ secrets.S3_BUCKET }}
42+
run: bun run deploy:marketplace-data
43+
44+
- name: Notify deployment success
45+
if: success()
46+
run: |
47+
echo "🚀 Marketplace deployment completed successfully!"
48+
echo "Environment: ${{ github.event.inputs.environment || 'default' }}"
49+
echo "Commit: ${{ github.sha }}"
50+
51+
- name: Notify deployment failure
52+
if: failure()
53+
run: |
54+
echo "❌ Marketplace deployment failed!"
55+
echo "Environment: ${{ github.event.inputs.environment || 'default' }}"
56+
echo "Commit: ${{ github.sha }}"
57+
exit 1

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ coverage
33
dist
44
node_modules
55
.DS_Store
6-
.tsbuildinfo
6+
*.tsbuildinfo
77
public/imgs/
88
pnpm-lock.yaml
99
.local
1010
*.local
1111
*.local.*
1212
local/
13+
.env.*
14+
!.env.*.template

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN --mount=type=cache,target=/root/.bun \
1313
done
1414

1515
# 构建
16-
RUN bun run build
16+
RUN bun run build:runtime
1717

1818
# --------- runner -----------
1919
FROM node:22-alpine AS runner
@@ -25,7 +25,6 @@ RUN apk add --no-cache\
2525

2626
# copy running files
2727
COPY --from=builder /app/dist/ ./dist/
28-
COPY --from=builder /app/dist/public/ ./public/
2928

3029
ENV NODE_ENV=production
3130
ENV PORT=3000

README_zh_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ FastGPT 已有系统工具已经迁移到这个仓库,新工具也将在这个
2525
## 系统工具基础设施
2626

2727
- [x] 工具独立运行
28-
- [ ] 热插拔
28+
- [x] 热插拔
29+
- [x] 工具版本管理
30+
- [x] SSE 流响应
2931
- [ ] 更优雅的 Secret 配置
3032
- [ ] 可视化调试
3133
- [ ] 反向调用 FastGPT
32-
- [ ] 工具版本管理
33-
- [ ] SSE 流响应
3434
- [ ] 更多安全策略
3535

3636
## 文档
3737

38-
- [系统工具开发指南](https://doc.tryfastgpt.ai/docs/introduction/guide/plugins/dev_system_tool)
39-
- [设计文档](https://doc.tryfastgpt.ai/docs/introduction/development/design/design_plugin)
38+
- [系统工具开发指南](https://doc.fastgpt.io/docs/introduction/guide/plugins/dev_system_tool)
39+
- [设计文档](https://doc.fastgpt.io/docs/introduction/development/design/design_plugin)
4040
- [开发规范](./dev_zh_CN.md)

0 commit comments

Comments
 (0)