From 2f3dc4cbce099ea93ca08458d65051bbcc6f6ffa Mon Sep 17 00:00:00 2001 From: ebakkum <269767500+ebakkum@users.noreply.github.com> Date: Wed, 7 Oct 2026 15:18:20 -0500 Subject: [PATCH] Merge main back into develop during release Add a release workflow step between tag creation and the develop version bump that merges main into develop, so the release merge commit is part of develop's history. The step is skipped when main is already an ancestor of develop, keeping re-runs idempotent. CONTRIBUTING.md documents the new step and a verification check. --- .github/workflows/release.yml | 12 ++++++++++++ CONTRIBUTING.md | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5822c13..15ff1de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,6 +106,18 @@ jobs: git push origin "v${NEW_VERSION}" fi + - name: Merge main back into develop + env: + NEW_VERSION: ${{ inputs.new_version }} + run: | + git checkout develop + if git merge-base --is-ancestor main develop; then + echo "main already merged into develop, skipping." + else + git merge main --no-ff -m "Merge main into develop after v${NEW_VERSION} release" + git push origin develop + fi + - name: Bump develop to next dev version env: NEXT_DEV_VERSION: ${{ inputs.next_dev_version }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a77f672..9dccf00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,9 +88,10 @@ Releases are self-service via GitHub Actions. 4. Commits and pushes the release changes to `develop` 5. Merges `develop → main` (no fast-forward) 6. Creates and pushes tag `vX.Y.Z` -7. Bumps `develop` to `next_dev_version` with a `- TBD` changelog placeholder -8. Packs the NuGet package (`.nupkg` and `.snupkg`) and publishes both to NuGet.org -9. Creates a GitHub Release +7. Merges `main` back into `develop` (no fast-forward) so the release merge commit is in `develop`'s history +8. Bumps `develop` to `next_dev_version` with a `- TBD` changelog placeholder +9. Packs the NuGet package (`.nupkg` and `.snupkg`) and publishes both to NuGet.org +10. Creates a GitHub Release The workflow is idempotent — if it fails partway through and is re-run with the same inputs, it safely skips steps that already completed. @@ -100,6 +101,7 @@ After the workflow completes: - Tag `vX.Y.Z` is visible under [Releases](https://github.com/peakflames/SharpBucket/releases) - `develop` is bumped to `next_dev_version` with a `- TBD` placeholder in `CHANGELOG.md` +- `main` is an ancestor of `develop`: `git merge-base --is-ancestor origin/main origin/develop` exits 0 - Package appears on NuGet.org within a few minutes: `https://www.nuget.org/packages/Peakflames.SharpBucket/X.Y.Z` ---