forked from anomalyco/opentui
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (57 loc) · 1.75 KB
/
Copy pathnpm-latest-release.yml
File metadata and controls
71 lines (57 loc) · 1.75 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
name: NPM Latest Release
on:
push:
tags:
- "v*"
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.1
- name: Extract version from tag
id: extract_version
run: |
TAG=${GITHUB_REF#refs/tags/v}
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "Extracted version: $TAG"
- name: Check version matches package.json
run: |
TAG_VERSION="${{ steps.extract_version.outputs.version }}"
# Check packages/*/package.json versions (excluding vue by default)
for pkg in packages/*/; do
# Skip vue package
if [[ "$pkg" == "packages/vue/" ]]; then
echo "Skipping vue package version check"
continue
fi
if [ -f "$pkg/package.json" ]; then
PKG_VERSION=$(node -p "require('./$pkg/package.json').version")
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Package $pkg version ($PKG_VERSION) does not match tag version ($TAG_VERSION)"
exit 1
fi
fi
done
echo "All package versions match tag version: $TAG_VERSION"
- name: Install dependencies
run: bun i
- name: Build packages
run: bun run build
- name: Publish packages
run: bun run publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CI: true