Skip to content

Commit 188ef18

Browse files
committed
chore: update ci
1 parent 4d89b45 commit 188ef18

7 files changed

Lines changed: 103 additions & 69 deletions

File tree

.github/workflows/ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- "v*"
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build-and-test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: lts/*
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install
34+
35+
- name: Build
36+
run: pnpm run build
37+
38+
- name: Lint
39+
run: pnpm run lint
40+
41+
- name: Typecheck
42+
run: pnpm run typecheck
43+
44+
- name: Test
45+
run: pnpm run test
46+
47+
publish:
48+
needs: build-and-test
49+
if: startsWith(github.ref, 'refs/tags/v')
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Install pnpm
58+
uses: pnpm/action-setup@v4
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: lts/*
64+
cache: pnpm
65+
registry-url: "https://registry.npmjs.org"
66+
67+
- name: Install dependencies
68+
run: pnpm install
69+
70+
- name: Build
71+
run: pnpm run build
72+
73+
- name: Extract version from tag
74+
id: version
75+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
76+
77+
- name: Sync package versions
78+
run: |
79+
VERSION=${{ steps.version.outputs.VERSION }}
80+
echo "Setting all packages to version $VERSION"
81+
82+
# Update version in all package.json files
83+
for pkg in packages/*/package.json; do
84+
jq --arg v "$VERSION" '.version = $v' "$pkg" > tmp.json && mv tmp.json "$pkg"
85+
echo "$pkg: $VERSION"
86+
done
87+
88+
# Note: pnpm automatically replaces workspace:^ with ^VERSION during publish
89+
90+
- name: Publish all packages
91+
run: pnpm -r publish --access public --no-git-checks
92+
env:
93+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
94+
95+
- name: Create GitHub Release
96+
run: npx changelogithub
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/unit-test.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"format": "prettier --write \"packages/**/*.{ts,tsx}\"",
1212
"format:check": "prettier --check \"packages/**/*.{ts,tsx}\"",
1313
"clean": "pnpm -r exec rm -rf dist node_modules",
14-
"release": "pnpm run build && bumpp -r && pnpm -r publish --access public --no-git-checks"
14+
"release": "bumpp -r --commit 'chore: release v%s' --tag 'v%s' --push"
1515
},
1616
"devDependencies": {
1717
"@eslint/js": "^9.18.0",

packages/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"react": ">=18.0.0"
5959
},
6060
"dependencies": {
61-
"@replanejs/react": "workspace:*",
62-
"@replanejs/sdk": "workspace:*"
61+
"@replanejs/react": "workspace:^",
62+
"@replanejs/sdk": "workspace:^"
6363
},
6464
"devDependencies": {
6565
"@testing-library/jest-dom": "^6.9.1",

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"react": ">=18.0.0"
4949
},
5050
"dependencies": {
51-
"@replanejs/sdk": "workspace:*"
51+
"@replanejs/sdk": "workspace:^"
5252
},
5353
"devDependencies": {
5454
"@testing-library/jest-dom": "^6.9.1",

packages/svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"svelte": ">=4.0.0"
4949
},
5050
"dependencies": {
51-
"@replanejs/sdk": "workspace:*"
51+
"@replanejs/sdk": "workspace:^"
5252
},
5353
"devDependencies": {
5454
"@sveltejs/package": "^2.3.10",

0 commit comments

Comments
 (0)