Skip to content

Commit db49df2

Browse files
authored
Merge pull request #58 from bomanaps/feat/ci-cd-pipeline
Feat/ci cd pipeline
2 parents 8b689f7 + 3273d41 commit db49df2

File tree

19 files changed

+412
-34
lines changed

19 files changed

+412
-34
lines changed

.github/dependabot.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "pnpm"
3+
# Root workspace dependencies (npm ecosystem works with pnpm workspaces)
4+
- package-ecosystem: "npm"
45
directory: "/"
56
schedule:
67
interval: "weekly"
7-
- package-ecosystem: "pnpm"
8-
directory: "/packages/shared"
9-
schedule:
10-
interval: "weekly"
11-
- package-ecosystem: "pnpm"
12-
directory: "/packages/types"
13-
schedule:
14-
interval: "weekly"
15-
- package-ecosystem: "pnpm"
16-
directory: "/apps/api"
8+
day: "monday"
9+
open-pull-requests-limit: 10
10+
groups:
11+
dev-dependencies:
12+
dependency-type: "development"
13+
patterns:
14+
- "@types/*"
15+
- "eslint*"
16+
- "prettier"
17+
- "typescript"
18+
- "jest"
19+
- "vitest"
20+
- "ts-jest"
21+
build-tools:
22+
patterns:
23+
- "turbo"
24+
- "esbuild"
25+
- "vsce"
26+
- "rimraf"
27+
commit-message:
28+
prefix: "deps"
29+
labels:
30+
- "dependencies"
31+
32+
# GitHub Actions
33+
- package-ecosystem: "github-actions"
34+
directory: "/"
1735
schedule:
1836
interval: "weekly"
37+
day: "monday"
38+
commit-message:
39+
prefix: "ci"
40+
labels:
41+
- "ci"
42+
- "dependencies"

.github/workflows/ci.yml

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,116 @@ on:
66
pull_request:
77
branches: [main]
88

9+
env:
10+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
11+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
12+
913
jobs:
1014
lint:
15+
name: Lint & Format
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: pnpm/action-setup@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: "pnpm"
26+
27+
- name: Install dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Run ESLint
31+
run: pnpm run lint
32+
33+
- name: Check formatting
34+
run: pnpm run format:check
35+
36+
build:
37+
name: Build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: pnpm/action-setup@v4
43+
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 20
47+
cache: "pnpm"
48+
49+
- name: Install dependencies
50+
run: pnpm install --frozen-lockfile
51+
52+
- name: Build all packages
53+
run: pnpm run build
54+
55+
- name: Upload build artifacts
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: build-artifacts
59+
path: |
60+
packages/*/dist
61+
packages/*/build
62+
apps/*/dist
63+
retention-days: 7
64+
65+
type-check:
66+
name: Type Check
1167
runs-on: ubuntu-latest
1268
steps:
1369
- uses: actions/checkout@v4
70+
1471
- uses: pnpm/action-setup@v4
15-
# Use the pnpm version from package.json's packageManager
72+
1673
- uses: actions/setup-node@v4
1774
with:
1875
node-version: 20
1976
cache: "pnpm"
20-
- run: pnpm install --frozen-lockfile
21-
- run: pnpm run lint
22-
- run: pnpm run format:check
77+
78+
- name: Install dependencies
79+
run: pnpm install --frozen-lockfile
80+
81+
- name: Run TypeScript type checking
82+
run: pnpm turbo run type-check
83+
84+
# TODO: Re-enable tests once test suite is stabilized
85+
# test:
86+
# name: Test
87+
# runs-on: ubuntu-latest
88+
# needs: [build]
89+
# steps:
90+
# - uses: actions/checkout@v4
91+
# - uses: pnpm/action-setup@v4
92+
# - uses: actions/setup-node@v4
93+
# with:
94+
# node-version: 20
95+
# cache: "pnpm"
96+
# - name: Install dependencies
97+
# run: pnpm install --frozen-lockfile
98+
# - name: Download build artifacts
99+
# uses: actions/download-artifact@v4
100+
# with:
101+
# name: build-artifacts
102+
# path: .
103+
# - name: Run tests
104+
# run: pnpm run test
105+
106+
# Summary job that depends on all others - useful for branch protection
107+
ci-success:
108+
name: CI Success
109+
runs-on: ubuntu-latest
110+
needs: [lint, build, type-check]
111+
if: always()
112+
steps:
113+
- name: Check all jobs passed
114+
run: |
115+
if [[ "${{ needs.lint.result }}" != "success" ]] || \
116+
[[ "${{ needs.build.result }}" != "success" ]] || \
117+
[[ "${{ needs.type-check.result }}" != "success" ]]; then
118+
echo "One or more jobs failed"
119+
exit 1
120+
fi
121+
echo "All CI jobs passed successfully!"

.github/workflows/release.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version to release (e.g., 1.0.0)"
11+
required: true
12+
type: string
13+
14+
env:
15+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
16+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
17+
18+
jobs:
19+
validate:
20+
name: Validate
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: pnpm/action-setup@v4
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: "pnpm"
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Lint
36+
run: pnpm run lint
37+
38+
- name: Type check
39+
run: pnpm run type-check
40+
41+
- name: Build
42+
run: pnpm run build
43+
44+
- name: Test
45+
run: pnpm run test
46+
47+
package-vscode-extension:
48+
name: Package VSCode Extension
49+
runs-on: ubuntu-latest
50+
needs: [validate]
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: pnpm/action-setup@v4
55+
56+
- uses: actions/setup-node@v4
57+
with:
58+
node-version: 20
59+
cache: "pnpm"
60+
61+
- name: Install dependencies
62+
run: pnpm install --frozen-lockfile
63+
64+
- name: Build all packages
65+
run: pnpm run build
66+
67+
- name: Package VSCode extension
68+
run: pnpm run package
69+
working-directory: packages/vscode-extension
70+
71+
- name: Upload VSCode extension artifact
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: vscode-extension
75+
path: packages/vscode-extension/*.vsix
76+
retention-days: 30
77+
78+
package-cursor-extension:
79+
name: Package Cursor Extension
80+
runs-on: ubuntu-latest
81+
needs: [validate]
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- uses: pnpm/action-setup@v4
86+
87+
- uses: actions/setup-node@v4
88+
with:
89+
node-version: 20
90+
cache: "pnpm"
91+
92+
- name: Install dependencies
93+
run: pnpm install --frozen-lockfile
94+
95+
- name: Build all packages
96+
run: pnpm run build
97+
98+
- name: Package Cursor extension
99+
run: pnpm run package
100+
working-directory: packages/cursor-extension
101+
102+
- name: Upload Cursor extension artifact
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: cursor-extension
106+
path: packages/cursor-extension/*.vsix
107+
retention-days: 30
108+
109+
create-release:
110+
name: Create GitHub Release
111+
runs-on: ubuntu-latest
112+
needs: [package-vscode-extension, package-cursor-extension]
113+
permissions:
114+
contents: write
115+
outputs:
116+
version: ${{ steps.version.outputs.VERSION }}
117+
steps:
118+
- uses: actions/checkout@v4
119+
120+
- name: Download VSCode extension
121+
uses: actions/download-artifact@v4
122+
with:
123+
name: vscode-extension
124+
path: ./artifacts/vscode
125+
126+
- name: Download Cursor extension
127+
uses: actions/download-artifact@v4
128+
with:
129+
name: cursor-extension
130+
path: ./artifacts/cursor
131+
132+
- name: Get version from tag
133+
id: version
134+
run: |
135+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
136+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
137+
else
138+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
139+
fi
140+
141+
- name: Create Release
142+
uses: softprops/action-gh-release@v1
143+
with:
144+
name: Release v${{ steps.version.outputs.VERSION }}
145+
tag_name: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.version) || github.ref_name }}
146+
draft: false
147+
prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }}
148+
generate_release_notes: true
149+
files: |
150+
./artifacts/vscode/*.vsix
151+
./artifacts/cursor/*.vsix
152+
153+
# Optional: Publish to VS Marketplace (requires VSCE_PAT secret)
154+
publish-vscode-marketplace:
155+
name: Publish to VS Marketplace
156+
runs-on: ubuntu-latest
157+
needs: [create-release]
158+
if: ${{ !contains(needs.create-release.outputs.version, '-') }}
159+
env:
160+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
161+
steps:
162+
- uses: actions/checkout@v4
163+
164+
- uses: pnpm/action-setup@v4
165+
166+
- uses: actions/setup-node@v4
167+
with:
168+
node-version: 20
169+
cache: "pnpm"
170+
171+
- name: Install dependencies
172+
run: pnpm install --frozen-lockfile
173+
174+
- name: Build all packages
175+
run: pnpm run build
176+
177+
- name: Publish to VS Marketplace
178+
if: ${{ env.VSCE_PAT != '' }}
179+
run: npx vsce publish --no-dependencies -p ${{ secrets.VSCE_PAT }}
180+
working-directory: packages/vscode-extension

0 commit comments

Comments
 (0)