-
-
Notifications
You must be signed in to change notification settings - Fork 849
146 lines (140 loc) · 4.02 KB
/
release.yml
File metadata and controls
146 lines (140 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Release
on:
push:
branches:
- main
jobs:
test-packages:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- cli
- core
- create-voltagent-app
- docs-mcp
- internal
- logger
- postgres
- supabase
- voice
- server-core
- libsql
fail-fast: false
name: Test ${{ matrix.package }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Set package scope
id: scope
run: |
if [[ "${{ matrix.package }}" == "create-voltagent-app" ]]; then
echo "scope=create-voltagent-app" >> $GITHUB_OUTPUT
else
echo "scope=@voltagent/${{ matrix.package }}" >> $GITHUB_OUTPUT
fi
- name: Build Package and Dependencies
run: lerna run build --scope "${{ steps.scope.outputs.scope }}" --include-dependencies
- name: Test Package
run: lerna run test --scope "${{ steps.scope.outputs.scope }}"
e2e-tests:
runs-on: ubuntu-latest
name: E2E Tests
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Build E2E Dependencies
run: pnpm lerna run build --scope @voltagent/e2e --include-dependencies
- name: Run E2E Tests
run: pnpm --filter @voltagent/e2e test
publish:
needs: [test-packages, e2e-tests]
permissions:
contents: write
id-token: write
issues: read
pull-requests: write
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-stable-release
cancel-in-progress: true
outputs:
published: ${{ steps.changesets.outputs.published }}
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: voltagent_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.VOLTAGENT_BOT }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install Dependencies
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Build
run: pnpm build:all
- name: Lint with Biome
run: pnpm lint:ci
- name: Syncpack
run: pnpm sp lint
- name: Publint
run: pnpm publint:all
# - name: Are The Types Wrong
# run: pnpm attw:all
- name: PostgreSQL Integration Tests
run: |
cd packages/postgres
npm run test:integration:ci
env:
DATABASE_URL: postgresql://test:test@localhost:5432/voltagent_test
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm version-packages
publish: pnpm changeset publish
commit: "ci(changesets): version packages"
title: "ci(changesets): version packages"
env:
GITHUB_TOKEN: ${{ secrets.VOLTAGENT_BOT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}