Skip to content

Commit eefab54

Browse files
authored
Merge pull request #194 from vue-pivottable/develop
Release: 1.1.2-beta.1750331861
2 parents 6af5237 + 045e4ba commit eefab54

35 files changed

+3258
-974
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/pr-check.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
8+
9+
jobs:
10+
lint-and-type-check:
11+
name: Lint and Type Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '22.10.0'
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: latest
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Run ESLint
31+
run: |
32+
echo "Linting main package..."
33+
pnpm lint
34+
echo "Linting all workspace packages..."
35+
pnpm -r lint || true # Continue even if some packages don't have lint script
36+
37+
- name: Run TypeScript type check
38+
run: |
39+
echo "Checking main package..."
40+
pnpm typecheck
41+
echo "Checking all workspace packages..."
42+
pnpm -r typecheck || true # Continue even if some packages don't have typecheck script
43+
44+
- name: Check for changesets
45+
run: |
46+
if [ -n "$(ls -A .changeset/*.md 2>/dev/null | grep -v README.md)" ]; then
47+
echo "✅ Changeset found"
48+
else
49+
echo "⚠️ No changeset found. Please add a changeset with 'pnpm changeset add'"
50+
echo " This is required for all changes that affect published packages."
51+
exit 1
52+
fi
53+
54+
build:
55+
name: Build Check
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Setup Node.js
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: '22.10.0'
65+
66+
- name: Setup pnpm
67+
uses: pnpm/action-setup@v2
68+
with:
69+
version: latest
70+
71+
- name: Install dependencies
72+
run: pnpm install
73+
74+
- name: Build all packages
75+
run: pnpm build:all
76+
77+
- name: Check build output
78+
run: |
79+
# Check main package
80+
if [ ! -d "dist" ]; then
81+
echo "❌ Main package build output not found"
82+
exit 1
83+
fi
84+
85+
# Check sub-packages
86+
for pkg in packages/*/; do
87+
if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then
88+
if [ ! -d "$pkg/dist" ]; then
89+
echo "❌ Build output not found for $pkg"
90+
exit 1
91+
fi
92+
fi
93+
done
94+
95+
echo "✅ All packages built successfully"
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
name: Release Develop (Pre-release)
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
pre-release:
12+
name: Pre-release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
18+
id-token: write
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '22.10.0'
29+
registry-url: 'https://registry.npmjs.org/'
30+
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v2
33+
with:
34+
version: latest
35+
36+
- name: Install dependencies
37+
run: pnpm install
38+
39+
- name: Check for changesets
40+
id: changesets-check
41+
run: |
42+
if [ -n "$(ls -A .changeset/*.md 2>/dev/null | grep -v README.md)" ]; then
43+
echo "has_changesets=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "has_changesets=false" >> $GITHUB_OUTPUT
46+
fi
47+
48+
- name: Version packages as beta
49+
id: version
50+
if: steps.changesets-check.outputs.has_changesets == 'true'
51+
run: |
52+
# Apply changesets and consume them
53+
pnpm changeset version
54+
55+
# Update to beta versions
56+
MAIN_VERSION=$(node -p "require('./package.json').version")
57+
TIMESTAMP=$(date +%s)
58+
59+
# Remove ALL existing beta suffixes if present and add new one
60+
CLEAN_VERSION=$(echo "$MAIN_VERSION" | sed 's/-beta\.[0-9]*//g')
61+
BETA_VERSION="${CLEAN_VERSION}-beta.${TIMESTAMP}"
62+
63+
# Update main package
64+
npm version $BETA_VERSION --no-git-tag-version
65+
66+
# Update sub-packages
67+
for pkg in packages/*/; do
68+
if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then
69+
cd "$pkg"
70+
PKG_VERSION=$(node -p "require('./package.json').version")
71+
# Remove ALL existing beta suffixes if present and add new one
72+
PKG_CLEAN=$(echo "$PKG_VERSION" | sed 's/-beta\.[0-9]*//g')
73+
PKG_BETA="${PKG_CLEAN}-beta.${TIMESTAMP}"
74+
npm version $PKG_BETA --no-git-tag-version
75+
cd -
76+
fi
77+
done
78+
79+
# Commit all changes
80+
git config user.name "github-actions[bot]"
81+
git config user.email "github-actions[bot]@users.noreply.github.com"
82+
git add -A
83+
git commit -m "chore: prepare beta release"
84+
git push origin develop
85+
86+
echo "version=$BETA_VERSION" >> $GITHUB_OUTPUT
87+
88+
- name: Run quality checks
89+
if: steps.changesets-check.outputs.has_changesets == 'true'
90+
run: |
91+
echo "Running type checks..."
92+
pnpm typecheck
93+
pnpm -r typecheck || true
94+
95+
echo "Running linting..."
96+
pnpm lint
97+
pnpm -r lint || true
98+
99+
- name: Build packages
100+
if: steps.changesets-check.outputs.has_changesets == 'true'
101+
run: |
102+
set -e # Exit immediately if any command fails
103+
echo "Building main package first..."
104+
pnpm build # Build main package first to generate type declarations
105+
106+
echo "Building sub-packages..."
107+
pnpm -r --filter './packages/*' build # Build sub-packages after main
108+
109+
- name: Create GitHub Pre-release
110+
if: steps.changesets-check.outputs.has_changesets == 'true'
111+
id: create-release
112+
uses: actions/create-release@v1
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
with:
116+
tag_name: vue-pivottable@${{ steps.version.outputs.version }}
117+
release_name: vue-pivottable@${{ steps.version.outputs.version }}
118+
draft: false
119+
prerelease: true
120+
body: |
121+
## 🚧 Pre-release (Beta)
122+
123+
This is a pre-release version. It may contain bugs and breaking changes.
124+
125+
Install with: `npm install vue-pivottable@beta`
126+
127+
### Version: ${{ steps.version.outputs.version }}
128+
129+
- name: Publish pre-release to npm
130+
if: steps.changesets-check.outputs.has_changesets == 'true' && steps.create-release.outcome == 'success'
131+
run: |
132+
# Publish with beta tag only after GitHub release is created
133+
node scripts/release-packages-beta.js
134+
env:
135+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
136+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
137+
NPM_TOKEN_SUMIN: ${{ secrets.NPM_TOKEN_SUMIN }}
138+
139+
- name: Create or Update PR to main
140+
if: steps.changesets-check.outputs.has_changesets == 'true'
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
run: |
144+
# 현재 버전 가져오기
145+
VERSION=$(node -p "require('./package.json').version")
146+
147+
# 기존 PR 확인
148+
PR_NUMBER=$(gh pr list --base main --head develop --state open --json number -q '.[0].number')
149+
150+
if [ -z "$PR_NUMBER" ]; then
151+
# 새 PR 생성
152+
gh pr create \
153+
--base main \
154+
--head develop \
155+
--title "Release: $VERSION" \
156+
--body "## 🚀 Release $VERSION
157+
158+
This PR contains the latest beta release ready for production.
159+
160+
### Beta Version
161+
- $VERSION
162+
163+
### Packages to be released
164+
- vue-pivottable: $VERSION
165+
- Check sub-packages for version updates
166+
167+
### Pre-release Testing
168+
- Beta version has been published to npm with tag @beta
169+
- Install with: \`npm install vue-pivottable@beta\`
170+
171+
### Release Notes
172+
See [CHANGELOG.md](./CHANGELOG.md) for details.
173+
174+
---
175+
⚠️ **Note**: This PR will be automatically updated if new changes are pushed to develop."
176+
else
177+
# 기존 PR 업데이트
178+
echo "Updating existing PR #$PR_NUMBER with new beta version..."
179+
180+
gh pr edit $PR_NUMBER \
181+
--title "Release: $VERSION" \
182+
--body "## 🚀 Release $VERSION (Updated)
183+
184+
This PR has been automatically updated with the latest beta release.
185+
186+
### Current Beta Version
187+
- $VERSION
188+
189+
### Packages to be released
190+
- vue-pivottable: $VERSION
191+
- Check sub-packages for version updates
192+
193+
### Pre-release Testing
194+
- Beta version has been published to npm with tag @beta
195+
- Install with: \`npm install vue-pivottable@beta\`
196+
197+
### ⚠️ Important
198+
**This PR has been updated with new commits. Please review the changes again.**
199+
200+
### Release Notes
201+
See [CHANGELOG.md](./CHANGELOG.md) for details.
202+
203+
---
204+
Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
205+
206+
# PR을 ready for review 상태로 설정
207+
gh pr ready $PR_NUMBER
208+
209+
# auto-updated 라벨 추가
210+
gh pr edit $PR_NUMBER --add-label "auto-updated,needs-review"
211+
fi

0 commit comments

Comments
 (0)