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/github-releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eggdrop": patch
---

Rename promote-to-main workflow to auto-promote-and-release and add automatic GitHub Release creation. Releases are created with version tags (v0.x.x) and changelog content extracted from CHANGELOG.md.
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"Bash(pnpm changeset:*)",
"Bash(source ~/.nvm/nvm.sh)",
"Bash(nvm use:*)",
"Bash(pnpm exec playwright test:*)"
"Bash(pnpm exec playwright test:*)",
"Bash(git push:*)",
"Bash(npm install:*)"
],
"deny": [],
"ask": []
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/auto-promote-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Automatically merges dev into main after a "Version Packages" PR is merged
# Creates a GitHub Release with changelog, then Vercel auto-deploys main to production
name: Auto Promote and Release

on:
pull_request:
types: [closed]
branches: [dev]
# Keep manual trigger as backup
workflow_dispatch:

jobs:
promote-and-release:
name: Promote to main and create release
runs-on: ubuntu-latest
# Only run if PR was merged (not just closed) AND is a Version Packages PR
# For workflow_dispatch, always run
if: >
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
contains(github.event.pull_request.title, 'Version Packages'))
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Merge dev into main
run: |
git checkout main
git pull origin main
git merge origin/dev --no-edit
git push origin main

- name: Get version from package.json
id: get-version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

- name: Check if tag exists
id: tag-check
run: |
if git rev-parse "v${{ steps.get-version.outputs.version }}" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Create and push tag
if: steps.tag-check.outputs.exists == 'false'
run: |
git tag "v${{ steps.get-version.outputs.version }}"
git push origin "v${{ steps.get-version.outputs.version }}"

- name: Extract changelog for this version
if: steps.tag-check.outputs.exists == 'false'
id: changelog
run: |
VERSION="${{ steps.get-version.outputs.version }}"
# Extract content between this version header and the next version header
CHANGELOG=$(sed -n "/^## ${VERSION}$/,/^## [0-9]/p" CHANGELOG.md | sed '$d' | tail -n +2)
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create GitHub Release
if: steps.tag-check.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get-version.outputs.version }}
name: v${{ steps.get-version.outputs.version }}
body: ${{ steps.changelog.outputs.content }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Summary
run: |
echo "✅ Successfully merged dev into main"
echo "🚀 Vercel will now deploy to production"
if [ "${{ steps.tag-check.outputs.exists }}" == "false" ]; then
echo "📦 Created GitHub Release v${{ steps.get-version.outputs.version }}"
else
echo "⏭️ Skipped release creation (tag v${{ steps.get-version.outputs.version }} already exists)"
fi
46 changes: 0 additions & 46 deletions .github/workflows/promote-to-main.yml

This file was deleted.