diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 133a429..aa5c7b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,10 @@ name: Build on: - # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) + # Trigger the workflow on pushes to only the 'main' and 'release' branches (this avoids duplicate checks being run + # e.g. for dependabot pull requests). The push to 'release' creates the release draft push: - branches: [main] + branches: [main, release] # Trigger the workflow on any pull request, except the ones to 'release': their head is main, whose push build # already runs for the same commit and shows up in the pull request pull_request: @@ -229,9 +230,10 @@ jobs: # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered + # Only for 'release': a draft created from main could be published before the code is merged into 'release' releaseDraft: name: Release Draft - if: github.event_name != 'pull_request' + if: github.event_name == 'push' && github.ref == 'refs/heads/release' needs: build runs-on: ubuntu-latest permissions: @@ -257,7 +259,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create v${{ needs.build.outputs.version }} \ - --target release \ + --target ${{ github.sha }} \ --draft \ --title "v${{ needs.build.outputs.version }}" \ --notes "$(cat << 'EOM' diff --git a/CHANGELOG.md b/CHANGELOG.md index b943afb..04691a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ # InlineProblems Changelog ## [Unreleased] +### Changed +- The GitHub release draft is created when a release is merged into the release branch, no longer on every push to main, so it cannot be published before the code is on the release branch ## [0.6.1] - 2026-10-13 diff --git a/README.md b/README.md index 5512a97..4a5f905 100644 --- a/README.md +++ b/README.md @@ -116,14 +116,13 @@ so everything goes through pull requests. under `## [0.6.2]` and opens the pull request "Prepare the 0.6.2 release" to `main`. The workflow stops if `[Unreleased]` is empty. No checks run on this pull request, it is created with the `GITHUB_TOKEN` -3. **Merge into `main`** - the Build workflow on `main` creates the release draft `v0.6.2` with the - notes of the `[0.6.2]` section. Every push to `main` replaces the draft +3. **Merge into `main`** 4. **Beta** - open the pull request `main -> release`, titled "main -> release for 0.6.2" with the changelog entry as description. The Beta Release workflow publishes `0.6.2-beta+RC.` to the Marketplace `beta` channel and creates the GitHub prerelease `v0.6.2-beta` with the changelog. Every new commit on the pull request publishes a new beta -5. **Merge into `release`** - once the beta is fine. This has to happen before the next step: the - release draft targets `release`, and the tag is created there when the draft is published +5. **Merge into `release`** - once the beta is fine. The Build workflow on `release` creates the + release draft `v0.6.2` with the notes of the `[0.6.2]` section, targeting the merged commit 6. **Release** - publish the release draft `v0.6.2` on GitHub. The Release workflow publishes the plugin to the Marketplace `default` and `beta` channels and attaches the ZIP to the release