Skip to content

Commit c067d50

Browse files
tthallosclaude
andcommitted
ci: sync versions on publish and trim Pages build
- publish.yml: derive version from git tag, rewrite package.json versions and internal `@pagus-kit/*: "*"` deps before publishing; include builder in the publish loop. - deploy-pages.yml: only build core/renderer/react before the playground to skip unrelated builder/mcp work. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 642d1e6 commit c067d50

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ jobs:
2727

2828
- run: npm ci
2929

30-
- run: npm run build
30+
- name: Build playground and its deps
31+
run: |
32+
npm run build:core
33+
npm run build:renderer
34+
npm run build:react
35+
npm run build -w playground
3136
3237
- uses: actions/upload-pages-artifact@v3
3338
with:

.github/workflows/publish.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,37 @@ jobs:
2020
cache: npm
2121
registry-url: https://registry.npmjs.org
2222

23+
- name: Sync versions from tag
24+
run: |
25+
VERSION="${GITHUB_REF_NAME#v}"
26+
echo "Publishing version $VERSION"
27+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
28+
node <<EOF
29+
const fs = require('fs');
30+
const version = process.env.GITHUB_REF_NAME.replace(/^v/, '');
31+
const pkgs = ['packages/core', 'packages/renderer', 'packages/builder', 'packages/react', 'packages/mcp'];
32+
for (const dir of pkgs) {
33+
const path = dir + '/package.json';
34+
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
35+
pkg.version = version;
36+
for (const field of ['dependencies', 'devDependencies', 'peerDependencies']) {
37+
if (!pkg[field]) continue;
38+
for (const name of Object.keys(pkg[field])) {
39+
if (name.startsWith('@pagus-kit/') && pkg[field][name] === '*') {
40+
pkg[field][name] = version;
41+
}
42+
}
43+
}
44+
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');
45+
}
46+
EOF
47+
2348
- run: npm ci
2449
- run: npm run build
2550

2651
- run: |
27-
for pkg in packages/core packages/renderer packages/react packages/mcp; do
28-
echo "Publishing $pkg..."
52+
for pkg in packages/core packages/renderer packages/builder packages/react packages/mcp; do
53+
echo "Publishing $pkg@$VERSION..."
2954
npm publish -w "$pkg" --access public --provenance
3055
done
3156
env:

0 commit comments

Comments
 (0)