Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/test-lazy-renderer-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-pivottable/lazy-table-renderer": patch
---

test: release 워크플로우 직접 배포 테스트
160 changes: 0 additions & 160 deletions .github/workflows/release-branch.yml

This file was deleted.

128 changes: 121 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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 }}