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
32 changes: 16 additions & 16 deletions .github/workflows/integrate-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id: check-pr
run: |
EXISTING_PR=$(gh pr list --base staging --head develop --json number --jq '.[0].number' || echo "")

if [ -n "$EXISTING_PR" ]; then
echo "pr_exists=true" >> $GITHUB_OUTPUT
echo "pr_number=$EXISTING_PR" >> $GITHUB_OUTPUT
Expand All @@ -48,7 +48,7 @@ jobs:
run: |
# Fetch staging branch
git fetch origin staging:staging || echo "Staging branch not found"

# Get the latest commits from develop that aren't in staging
if git rev-parse --verify origin/staging >/dev/null 2>&1; then
COMMITS=$(git log --pretty=format:"- %s (%h)" origin/staging..HEAD | head -20)
Expand All @@ -57,17 +57,17 @@ jobs:
COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD | head -20)
COMMIT_COUNT=$(git rev-list --count HEAD)
fi

# Escape for GitHub Actions output
COMMITS="${COMMITS//'%'/'%25'}"
COMMITS="${COMMITS//$'\n'/'%0A'}"
COMMITS="${COMMITS//$'\r'/'%0D'}"

echo "commits<<EOF" >> $GITHUB_OUTPUT
echo "$COMMITS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT

# Get timestamp
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT
Expand All @@ -77,7 +77,7 @@ jobs:
run: |
COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}"
TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}"

# Create PR body file
{
echo "## πŸš€ Integration from develop to staging"
Expand All @@ -103,7 +103,7 @@ jobs:
echo "- Multiple features can accumulate in this single PR"
echo "- Approval triggers the beta release process"
} > pr-body.md

gh pr create \
--base staging \
--head develop \
Expand All @@ -120,17 +120,17 @@ jobs:
COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}"
TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}"
COMMITS="${{ steps.commit-info.outputs.commits }}"

# Update PR title with commit count
gh pr edit $PR_NUMBER \
--title "πŸ”„ Integrate develop β†’ staging (${COMMIT_COUNT} commits)"

# Get current PR body
CURRENT_BODY=$(gh pr view $PR_NUMBER --json body --jq '.body')

# Create updated section
UPDATED_SECTION="### πŸ”„ Last Updated: ${TIMESTAMP}\nNew commits: ${COMMIT_COUNT}\n\n### πŸ“ Recent Commits\n${COMMITS}"

# Update or append the updated section
if echo "$CURRENT_BODY" | grep -q "### πŸ”„ Last Updated:"; then
# Replace existing update section
Expand All @@ -140,18 +140,18 @@ jobs:
# Append update section
NEW_BODY="$CURRENT_BODY\n\n---\n\n$UPDATED_SECTION"
fi

# Update PR body
echo "$NEW_BODY" > pr-body-update.md
gh pr edit $PR_NUMBER --body-file pr-body-update.md

# Add labels
gh pr edit $PR_NUMBER \
--add-label "needs-review"

# Set as ready for review
gh pr ready $PR_NUMBER || true

echo "βœ… Updated PR #${PR_NUMBER} with ${COMMIT_COUNT} new commits"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
echo "❌ Main package build output not found"
exit 1
fi
# Check sub-packages
for pkg in packages/*/; do
if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then
Expand All @@ -92,5 +92,5 @@ jobs:
fi
fi
done
echo "βœ… All packages built successfully"
echo "βœ… All packages built successfully"
165 changes: 86 additions & 79 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
echo "Running type checks..."
pnpm typecheck
pnpm -r typecheck || true

echo "Running linting..."
pnpm lint
pnpm -r lint || true
Expand All @@ -78,21 +78,21 @@ jobs:
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Run changesets version with beta
pnpm changeset version

# Add beta suffix to all updated packages
TIMESTAMP=$(date +%s)

# Update main package if version changed
if git diff --name-only | grep -q "^package.json$"; then
CURRENT_VERSION=$(node -p "require('./package.json').version")
BETA_VERSION="${CURRENT_VERSION}-beta.${TIMESTAMP}"
npm version $BETA_VERSION --no-git-tag-version
echo "Main package: $CURRENT_VERSION β†’ $BETA_VERSION"
fi

# Update sub-packages if versions changed
for pkg in packages/*/; do
if [ -d "$pkg" ] && git diff --name-only | grep -q "^$pkg"; then
Expand All @@ -107,7 +107,7 @@ jobs:
cd - > /dev/null
fi
done

# Commit all changes
git add -A
git commit -m "chore: version packages for beta release" || echo "No changes to commit"
Expand All @@ -122,15 +122,15 @@ jobs:
run: |
# Publish with beta tag
RELEASE_TAG=beta node scripts/release-packages.cjs

# Collect published versions
echo "published_versions<<EOF" >> $GITHUB_OUTPUT
echo "### Published Beta Versions" >> $GITHUB_OUTPUT

# Check main package
MAIN_VERSION=$(node -p "require('./package.json').version")
echo "- vue-pivottable@$MAIN_VERSION" >> $GITHUB_OUTPUT

# Check sub-packages
for pkg in packages/*/; do
if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then
Expand All @@ -153,7 +153,7 @@ jobs:
id: check-pr
run: |
EXISTING_PR=$(gh pr list --base main --head staging --json number --jq '.[0].number' || echo "")

if [ -n "$EXISTING_PR" ]; then
echo "pr_exists=true" >> $GITHUB_OUTPUT
echo "pr_number=$EXISTING_PR" >> $GITHUB_OUTPUT
Expand All @@ -168,42 +168,48 @@ jobs:
run: |
# Get the main package version for PR title
MAIN_VERSION=$(node -p "require('./package.json').version")

PUBLISHED_VERSIONS="${{ steps.publish.outputs.published_versions }}"

# Create PR body file
{
echo "## 🎯 Beta Release Ready for Production"
echo ""
echo "$PUBLISHED_VERSIONS"
echo ""
echo "### πŸ“‹ What happens next?"
echo "1. Review and test the beta versions"
echo "2. When approved and merged, this will:"
echo " - Update package.json versions (remove beta suffix)"
echo " - Generate/update CHANGELOG.md files"
echo " - Sync changes back to develop and staging"
echo " - **Note**: npm publish happens only when you create a version tag"
echo ""
echo "### 🏷️ After merge:"
echo "Create a version tag to trigger production release:"
echo '```bash'
echo "git checkout main"
echo "git pull origin main"
echo "git tag v\${VERSION}"
echo "git push origin v\${VERSION}"
echo '```'
echo ""
echo "### πŸ“¦ Install beta versions:"
echo '```bash'
echo "npm install vue-pivottable@beta"
echo "# or specific sub-packages"
echo "npm install @vue-pivottable/plotly-renderer@beta"
echo "npm install @vue-pivottable/lazy-table-renderer@beta"
echo '```'
echo ""
echo "---"
echo "*This PR was automatically created by the staging release workflow*"
} > pr-body.md

gh pr create \
--base main \
--head staging \
--title "πŸš€ Release: Beta versions ready for production" \
--body "## 🎯 Beta Release Ready for Production

${{ steps.publish.outputs.published_versions }}

### πŸ“‹ What happens next?
1. Review and test the beta versions
2. When approved and merged, this will:
- Update package.json versions (remove beta suffix)
- Generate/update CHANGELOG.md files
- Sync changes back to develop and staging
- **Note**: npm publish happens only when you create a version tag

### 🏷️ After merge:
Create a version tag to trigger production release:
\`\`\`bash
git checkout main
git pull origin main
git tag v\${VERSION}
git push origin v\${VERSION}
\`\`\`

### πŸ“¦ Install beta versions:
\`\`\`bash
npm install vue-pivottable@beta
# or specific sub-packages
npm install @vue-pivottable/plotly-renderer@beta
npm install @vue-pivottable/lazy-table-renderer@beta
\`\`\`

---
*This PR was automatically created by the staging release workflow*" \
--body-file pr-body.md \
--label "released" \
--label "auto-updated"
env:
Expand All @@ -215,48 +221,49 @@ npm install @vue-pivottable/lazy-table-renderer@beta
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
PR_NUMBER="${{ steps.check-pr.outputs.pr_number }}"
PUBLISHED_VERSIONS="${{ steps.publish.outputs.published_versions }}"

cat > pr-body-update.md << EOF
## 🎯 Beta Release Ready for Production

### ⏰ Last Updated: $TIMESTAMP
# Create updated PR body
{
echo "## 🎯 Beta Release Ready for Production"
echo ""
echo "### ⏰ Last Updated: $TIMESTAMP"
echo ""
echo "$PUBLISHED_VERSIONS"
echo ""
echo "### πŸ“‹ What happens next?"
echo "1. Review and test the beta versions"
echo "2. When approved and merged, this will:"
echo " - Update package.json versions (remove beta suffix)"
echo " - Generate/update CHANGELOG.md files"
echo " - Sync changes back to develop and staging"
echo " - **Note**: npm publish happens only when you create a version tag"
echo ""
echo "### 🏷️ After merge:"
echo "Create a version tag to trigger production release:"
echo '```bash'
echo "git checkout main"
echo "git pull origin main"
echo "git tag v\${VERSION}"
echo "git push origin v\${VERSION}"
echo '```'
echo ""
echo "### πŸ“¦ Install beta versions:"
echo '```bash'
echo "npm install vue-pivottable@beta"
echo "# or specific sub-packages"
echo "npm install @vue-pivottable/plotly-renderer@beta"
echo "npm install @vue-pivottable/lazy-table-renderer@beta"
echo '```'
echo ""
echo "---"
echo "*This PR was automatically updated by the staging release workflow*"
} > pr-body-update.md

$PUBLISHED_VERSIONS

### πŸ“‹ What happens next?
1. Review and test the beta versions
2. When approved and merged, this will:
- Update package.json versions (remove beta suffix)
- Generate/update CHANGELOG.md files
- Sync changes back to develop and staging
- **Note**: npm publish happens only when you create a version tag

### 🏷️ After merge:
Create a version tag to trigger production release:
\`\`\`bash
git checkout main
git pull origin main
git tag v\${VERSION}
git push origin v\${VERSION}
\`\`\`

### πŸ“¦ Install beta versions:
\`\`\`bash
npm install vue-pivottable@beta
# or specific sub-packages
npm install @vue-pivottable/plotly-renderer@beta
npm install @vue-pivottable/lazy-table-renderer@beta
\`\`\`

---
*This PR was automatically updated by the staging release workflow*
EOF

# Update PR body with new beta versions
gh pr edit $PR_NUMBER --body-file pr-body-update.md

# Update labels
gh pr edit $PR_NUMBER \
--add-label "needs-review"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading