From d2631076dce7dcf62a792f03ed4d829c1fd363c0 Mon Sep 17 00:00:00 2001 From: Seungwoo321 Date: Fri, 20 Jun 2025 08:54:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20release=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=EC=97=90=EC=84=9C=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EB=B0=B0=ED=8F=AC=20=EB=B0=8F=20=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=ED=99=94=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - release-branch.yml 삭제 (GITHUB_TOKEN으로 워크플로우 트리거 불가) - release.yml에서 release 브랜치 생성 후 직접: - npm 배포 - GitHub Release 생성 - develop 브랜치 자동 머지 - main 브랜치로 PR 생성 - PAT 없이도 모든 릴리스 프로세스가 정상 동작하도록 개선 --- .github/workflows/release-branch.yml | 160 --------------------------- .github/workflows/release.yml | 128 +++++++++++++++++++-- 2 files changed, 121 insertions(+), 167 deletions(-) delete mode 100644 .github/workflows/release-branch.yml diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml deleted file mode 100644 index 4152fa8..0000000 --- a/.github/workflows/release-branch.yml +++ /dev/null @@ -1,160 +0,0 @@ -name: Release Branch Deploy - -on: - push: - branches: - - 'release/v*' - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - deploy-and-sync: - name: Deploy and Sync - runs-on: ubuntu-latest - permissions: - contents: write - issues: write - pull-requests: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22.10.0' - registry-url: 'https://registry.npmjs.org/' - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - - name: Install dependencies - run: pnpm install - - - name: Build packages - run: | - echo "Building all packages..." - pnpm build:all - - - name: Publish to npm - run: | - # Publish with latest tag - node scripts/release-packages.cjs - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN_SUMIN: ${{ secrets.NPM_TOKEN_SUMIN }} - - - name: Create GitHub Releases - run: | - # Create release for each package with stable version - create_release() { - local PKG_NAME=$1 - local PKG_VERSION=$2 - local NPM_NAME=$3 - - echo "Creating release for $PKG_NAME@$PKG_VERSION" - - # Delete existing beta release if it exists - gh release delete "${PKG_NAME}@${PKG_VERSION}" --yes 2>/dev/null || true - - gh release create "${PKG_NAME}@${PKG_VERSION}" \ - --title "${PKG_NAME}@${PKG_VERSION}" \ - --notes "## 🚀 Stable Release - - This release promotes the beta version to stable. - - Install with: \`npm install ${NPM_NAME}@latest\` - - ### Version: ${PKG_VERSION}" \ - --target ${{ github.sha }} - } - - # Get version info from current branch - CURRENT_BRANCH="${{ github.ref_name }}" - VERSION="${CURRENT_BRANCH#release/v}" - - # Check main package - MAIN_VERSION=$(node -p "require('./package.json').version") - if [ "$MAIN_VERSION" = "$VERSION" ]; then - create_release "vue-pivottable" "$MAIN_VERSION" "vue-pivottable" - fi - - # Check sub-packages - for pkg in packages/*/; do - if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then - FULL_PKG_NAME=$(cd "$pkg" && node -p "require('./package.json').name") - PKG_VERSION=$(cd "$pkg" && node -p "require('./package.json').version") - - # Only create release if version doesn't contain beta - if [[ $PKG_VERSION != *"-beta"* ]]; then - create_release "$FULL_PKG_NAME" "$PKG_VERSION" "$FULL_PKG_NAME" - fi - fi - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Sync with develop - run: | - # Configure git - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - # Create a temporary branch for merging - TEMP_BRANCH="temp-sync-$(date +%s)" - git checkout -b $TEMP_BRANCH - - # Merge into develop - git checkout develop - git pull origin develop - git merge $TEMP_BRANCH --no-edit -m "chore: sync release ${{ github.ref_name }} to develop" - git push origin develop - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create PR to main - run: | - VERSION="${{ github.ref_name }}" - - gh pr create \ - --base main \ - --head "${{ github.ref_name }}" \ - --title "chore: update main with $VERSION" \ - --body "## 📦 Release Update - - This PR updates main branch with: - - ✅ Stable version numbers (beta suffix removed) - - ✅ Updated package.json files - - ✅ npm packages published - - ✅ GitHub releases created - - ### Published Packages - $(node -p " - const main = require('./package.json'); - let packages = \`- vue-pivottable@\${main.version}\`; - const fs = require('fs'); - const path = require('path'); - const packagesDir = './packages'; - if (fs.existsSync(packagesDir)) { - fs.readdirSync(packagesDir).forEach(dir => { - const pkgPath = path.join(packagesDir, dir, 'package.json'); - if (fs.existsSync(pkgPath)) { - const pkg = require(pkgPath); - packages += \`\\n- \${pkg.name}@\${pkg.version}\`; - } - }); - } - packages - ") - - **Note**: This release has been automatically synced with develop branch." \ - || echo "PR to main already exists or creation failed" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dd36de..a6f173a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,12 +135,126 @@ jobs: echo "release_branch=$RELEASE_BRANCH" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Trigger release branch workflow + - name: Checkout release branch if: steps.check-versions.outputs.has_beta == 'true' run: | - echo "Release branch created: ${{ steps.create-release.outputs.release_branch }}" - echo "The release branch workflow will handle:" - echo "- Publishing to npm" - echo "- Creating GitHub releases" - echo "- Syncing with develop (auto-merge)" - echo "- Creating PR to main" \ No newline at end of file + git checkout ${{ steps.create-release.outputs.release_branch }} + git pull origin ${{ steps.create-release.outputs.release_branch }} + + - name: Publish to npm + if: steps.check-versions.outputs.has_beta == 'true' + run: | + # Publish with latest tag + node scripts/release-packages.cjs + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN_SUMIN: ${{ secrets.NPM_TOKEN_SUMIN }} + + - name: Create GitHub Releases + if: steps.check-versions.outputs.has_beta == 'true' + run: | + # Create release for each package with stable version + create_release() { + local PKG_NAME=$1 + local PKG_VERSION=$2 + local NPM_NAME=$3 + + echo "Creating release for $PKG_NAME@$PKG_VERSION" + + # Delete existing beta release if it exists + gh release delete "${PKG_NAME}@${PKG_VERSION}" --yes 2>/dev/null || true + + gh release create "${PKG_NAME}@${PKG_VERSION}" \ + --title "${PKG_NAME}@${PKG_VERSION}" \ + --notes "## 🚀 Stable Release + + This release promotes the beta version to stable. + + Install with: \`npm install ${NPM_NAME}@latest\` + + ### Version: ${PKG_VERSION}" \ + --target ${{ github.sha }} + } + + # Get version info from current branch + VERSION="${{ steps.create-release.outputs.version }}" + + # Check main package + MAIN_VERSION=$(node -p "require('./package.json').version") + if [ "$MAIN_VERSION" = "$VERSION" ]; then + create_release "vue-pivottable" "$MAIN_VERSION" "vue-pivottable" + fi + + # Check sub-packages + for pkg in packages/*/; do + if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then + FULL_PKG_NAME=$(cd "$pkg" && node -p "require('./package.json').name") + PKG_VERSION=$(cd "$pkg" && node -p "require('./package.json').version") + + # Only create release if version doesn't contain beta + if [[ $PKG_VERSION != *"-beta"* ]]; then + create_release "$FULL_PKG_NAME" "$PKG_VERSION" "$FULL_PKG_NAME" + fi + fi + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Sync with develop + if: steps.check-versions.outputs.has_beta == 'true' + run: | + # Configure git + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + # Fetch latest develop + git fetch origin develop:develop + + # Merge release branch into develop + git checkout develop + git merge ${{ steps.create-release.outputs.release_branch }} --no-edit -m "chore: sync release ${{ steps.create-release.outputs.release_branch }} to develop" + git push origin develop + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create PR to main + if: steps.check-versions.outputs.has_beta == 'true' + run: | + VERSION="${{ steps.create-release.outputs.release_branch }}" + + gh pr create \ + --base main \ + --head "${{ steps.create-release.outputs.release_branch }}" \ + --title "chore: update main with $VERSION" \ + --body "## 📦 Release Update + + This PR updates main branch with: + - ✅ Stable version numbers (beta suffix removed) + - ✅ Updated package.json files + - ✅ npm packages published + - ✅ GitHub releases created + + ### Published Packages + $(node -p " + const main = require('./package.json'); + let packages = \`- vue-pivottable@\${main.version}\`; + const fs = require('fs'); + const path = require('path'); + const packagesDir = './packages'; + if (fs.existsSync(packagesDir)) { + fs.readdirSync(packagesDir).forEach(dir => { + const pkgPath = path.join(packagesDir, dir, 'package.json'); + if (fs.existsSync(pkgPath)) { + const pkg = require(pkgPath); + packages += \`\\n- \${pkg.name}@\${pkg.version}\`; + } + }); + } + packages + ") + + **Note**: This release has been automatically synced with develop branch." \ + || echo "PR to main already exists or creation failed" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 3769e7145bae9ed1eb23bd3e600f20c6c7a4ebf7 Mon Sep 17 00:00:00 2001 From: Seungwoo321 Date: Fri, 20 Jun 2025 08:55:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EC=9A=A9=20changeset=20=EC=B6=94=EA=B0=80=20(lazy-table-render?= =?UTF-8?q?er)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/test-lazy-renderer-workflow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/test-lazy-renderer-workflow.md diff --git a/.changeset/test-lazy-renderer-workflow.md b/.changeset/test-lazy-renderer-workflow.md new file mode 100644 index 0000000..397fa83 --- /dev/null +++ b/.changeset/test-lazy-renderer-workflow.md @@ -0,0 +1,5 @@ +--- +"@vue-pivottable/lazy-table-renderer": patch +--- + +test: release 워크플로우 직접 배포 테스트 \ No newline at end of file