-
-
Notifications
You must be signed in to change notification settings - Fork 4
150 lines (131 loc) · 5.21 KB
/
Copy pathcanary.yml
File metadata and controls
150 lines (131 loc) · 5.21 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
147
148
149
150
name: codingbuddy-canary
on:
push:
branches:
- master
- stag-**
paths:
- 'apps/mcp-server/**'
- 'packages/rules/**'
- 'packages/claude-code-plugin/**'
- '.antigravity/**'
- '.claude/**'
- '.codex/**'
- '.cursor/**'
- 'scripts/**'
- .github/workflows/canary.yml
permissions:
statuses: write
contents: read
jobs:
plugin-hooks-tests:
# Regression gate for #1490 — HUD installer must sync hooks/lib
# alongside the script. This job runs the Python pytest suites for
# the plugin hooks (no node/yarn build needed) so a broken installer
# cannot ship to canary or release.
if: github.repository == 'JeremyDev87/codingbuddy'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.11'
- name: Install pytest
run: python3 -m pip install --quiet pytest
- name: Run plugin hook test suites (#1490 regression gate)
working-directory: packages/claude-code-plugin
run: |
python3 -m pytest \
tests/test_atomic_sync_with_lib.py \
tests/test_session_start_hud.py \
tests/test_install_hook_with_lib.py \
tests/test_health_check.py \
-v --tb=short
- name: HUD install simulation (#1490 end-to-end gate)
run: bash packages/claude-code-plugin/scripts/verify-install-simulation.sh
publish-canary:
needs: plugin-hooks-tests
if: github.repository == 'JeremyDev87/codingbuddy'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '24'
- name: Restore dependencies from cache
id: cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Build mcp-server
run: yarn workspace codingbuddy build
# Generate a single canary version to ensure both packages use the same version
# This fixes the timestamp mismatch bug where rules and mcp-server had different versions
- name: Generate canary version
run: |
TIMESTAMP=$(date +%Y%m%d%H%M%S)
COMMIT_SHA=${GITHUB_SHA::7}
VERSION="0.0.0-canary.${TIMESTAMP}.g${COMMIT_SHA}"
if [ -z "$VERSION" ]; then
echo "::error::Failed to generate canary version"
exit 1
fi
echo "CANARY_VERSION=$VERSION" >> $GITHUB_ENV
echo "Generated canary version: $VERSION"
- name: Publish rules canary
working-directory: packages/rules
run: |
VERSION="${{ env.CANARY_VERSION }}"
cat <<< "$( jq --arg v "$VERSION" '.version = $v' package.json )" > package.json
yarn npm publish --tag canary
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish mcp-server canary
working-directory: apps/mcp-server
run: |
VERSION="${{ env.CANARY_VERSION }}"
# Update version and replace workspace dependency with canary version
cat <<< "$( jq --arg v "$VERSION" '.version = $v | .dependencies["codingbuddy-rules"] = $v' package.json )" > package.json
yarn npm publish --tag canary
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Output mcp-server canary version
working-directory: apps/mcp-server
run: |
name=$(jq -r .name package.json)
version=$(jq -r .version package.json)
yarn dlx action-status@0.1.1 --context "Published $name" --state success --description $version --url "https://unpkg.com/$name@$version/"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin
run: yarn workspace codingbuddy-claude-plugin build
- name: Publish plugin canary
working-directory: packages/claude-code-plugin
run: |
VERSION="${{ env.CANARY_VERSION }}"
cat <<< "$( jq --arg v "$VERSION" '.version = $v' package.json )" > package.json
yarn npm publish --tag canary
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Output plugin canary version
working-directory: packages/claude-code-plugin
run: |
name=$(jq -r .name package.json)
version=$(jq -r .version package.json)
yarn dlx action-status@0.1.1 --context "Published $name" --state success --description $version --url "https://unpkg.com/$name@$version/"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}