-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (62 loc) · 2.12 KB
/
Copy pathpublish.yml
File metadata and controls
73 lines (62 loc) · 2.12 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
name: Publish to npm
# Trigger when a new release is created OR when a version tag is pushed (so publish runs even if create-release skips)
on:
release:
types: [created]
push:
tags:
- 'v*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Extract version from tag
id: version
run: |
if [ -n "${{ github.event.release.tag_name }}" ]; then
TAG="${{ github.event.release.tag_name }}"
else
TAG="${GITHUB_REF#refs/tags/}"
fi
VERSION=${TAG#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION from tag: $TAG"
- name: Update package versions (CI only, not committed)
run: |
VERSION="${{ steps.version.outputs.version }}"
for pkg in packages/core packages/extension-* packages/create-app; do
[ -d "$pkg" ] && (cd "$pkg" && npm version "$VERSION" --no-git-tag-version) && echo "Updated $pkg to $VERSION"
done
- name: Build core package
run: npm run build
- name: Run type check
run: npm run type-check
continue-on-error: true
- name: Publish core, extensions, and create-app to npm
run: |
for pkg in packages/core packages/extension-* packages/create-app; do
if [ -d "$pkg" ]; then
if grep -q '"private":\s*true' "$pkg/package.json" 2>/dev/null; then
echo "Skipping $pkg (private)"
else
echo "Publishing $pkg..."
(cd "$pkg" && npm publish --access public --provenance)
fi
fi
done