From f11db368c9a0eae7a5dfe2240627c8294d60ee00 Mon Sep 17 00:00:00 2001 From: Kevin Maes Date: Fri, 19 Dec 2025 17:08:33 +0200 Subject: [PATCH 1/3] refactor: rename workflow to Release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify workflow name from "Auto Promote and Release" to "Release" and rename file from auto-promote-and-release.yml to release.yml. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../workflows/{auto-promote-and-release.yml => release.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{auto-promote-and-release.yml => release.yml} (96%) diff --git a/.github/workflows/auto-promote-and-release.yml b/.github/workflows/release.yml similarity index 96% rename from .github/workflows/auto-promote-and-release.yml rename to .github/workflows/release.yml index 71dbb08..7572a4c 100644 --- a/.github/workflows/auto-promote-and-release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ -# Automatically merges dev into main after a "Version Packages" PR is merged +# 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 +name: Release on: pull_request: From 703d8be5aa4066fa5cd06a51951a1b29a2c39e12 Mon Sep 17 00:00:00 2001 From: Kevin Maes Date: Fri, 19 Dec 2025 19:29:19 +0200 Subject: [PATCH 2/3] chore: add changeset for workflow rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .changeset/rename-release-workflow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rename-release-workflow.md diff --git a/.changeset/rename-release-workflow.md b/.changeset/rename-release-workflow.md new file mode 100644 index 0000000..70b2a34 --- /dev/null +++ b/.changeset/rename-release-workflow.md @@ -0,0 +1,5 @@ +--- +"eggdrop": patch +--- + +Rename release workflow from "Auto Promote and Release" to "Release" for simplicity. From cef590fa7c38568c395dde9851db928c5fec0e87 Mon Sep 17 00:00:00 2001 From: Kevin Maes Date: Fri, 19 Dec 2025 20:15:09 +0200 Subject: [PATCH 3/3] refactor: rename workflows to follow Changesets conventions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - version.yml → release.yml (creates Version Packages PR) - release.yml → deploy.yml (promotes to main, creates GitHub Release) This aligns with Changesets documentation which recommends using release.yml for the workflow that manages versioning. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .changeset/rename-release-workflow.md | 2 +- .github/workflows/deploy.yml | 91 +++++++++++++++++++++++++ .github/workflows/release.yml | 98 +++++++-------------------- .github/workflows/version.yml | 45 ------------ 4 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/version.yml diff --git a/.changeset/rename-release-workflow.md b/.changeset/rename-release-workflow.md index 70b2a34..a1cf3ea 100644 --- a/.changeset/rename-release-workflow.md +++ b/.changeset/rename-release-workflow.md @@ -2,4 +2,4 @@ "eggdrop": patch --- -Rename release workflow from "Auto Promote and Release" to "Release" for simplicity. +Rename workflows to follow Changesets conventions: version.yml becomes release.yml (creates Version Packages PR), and release.yml becomes deploy.yml (promotes to main and creates GitHub Release). diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f90a554 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,91 @@ +# 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: Deploy + +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<> $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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7572a4c..bbe7b81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,91 +1,45 @@ -# 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: Release on: - pull_request: - types: [closed] - branches: [dev] - # Keep manual trigger as backup + push: + branches: + - dev workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - promote-and-release: - name: Promote to main and create release + version: + name: Version Packages 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 + pull-requests: write steps: - - name: Checkout + - name: Checkout Repo 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: Setup pnpm + uses: pnpm/action-setup@v4 - - 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: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'pnpm' - - 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<> $GITHUB_OUTPUT - echo "$CHANGELOG" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + - name: Install Dependencies + run: pnpm install --frozen-lockfile - - name: Create GitHub Release - if: steps.tag-check.outputs.exists == 'false' - uses: softprops/action-gh-release@v2 + - name: Create Version PR + uses: changesets/action@v1 with: - tag_name: v${{ steps.get-version.outputs.version }} - name: v${{ steps.get-version.outputs.version }} - body: ${{ steps.changelog.outputs.content }} + version: pnpm run version 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 + # Use PAT to trigger CI workflows on PR updates + # Falls back to GITHUB_TOKEN if PAT not available + GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml deleted file mode 100644 index 686f860..0000000 --- a/.github/workflows/version.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Version - -on: - push: - branches: - - dev - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - version: - name: Version Packages - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: 'pnpm' - - - name: Install Dependencies - run: pnpm install --frozen-lockfile - - - name: Create Version PR - uses: changesets/action@v1 - with: - version: pnpm run version - env: - # Use PAT to trigger CI workflows on PR updates - # Falls back to GITHUB_TOKEN if PAT not available - GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN || secrets.GITHUB_TOKEN }}