-
-
Notifications
You must be signed in to change notification settings - Fork 17
chore(ci): migrate from release-please to release-drafter #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
488f816
chore: migrate from release-please to release-drafter and manual bump…
gildesmarais bcef3e9
chore: address PR review feedback on branch constraints and fork perm…
gildesmarais 96ccecb
chore: dynamically resolve TAG_SHA from checked out ref inside releas…
gildesmarais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name-template: 'v$RESOLVED_VERSION' | ||
| tag-template: 'v$RESOLVED_VERSION' | ||
|
|
||
| categories: | ||
| - title: '🚀 Features' | ||
| labels: | ||
| - 'feature' | ||
| - 'enhancement' | ||
| - 'feat' | ||
| - title: '🐛 Bug Fixes' | ||
| labels: | ||
| - 'bug' | ||
| - 'fix' | ||
| - title: '🧰 Maintenance' | ||
| labels: | ||
| - 'chore' | ||
| - 'documentation' | ||
| - 'dependencies' | ||
| - 'refactor' | ||
| - 'style' | ||
| - 'test' | ||
| - 'ci' | ||
|
|
||
| change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
|
|
||
| version-resolver: | ||
| major: | ||
| labels: | ||
| - 'major' | ||
| - 'breaking' | ||
| minor: | ||
| labels: | ||
| - 'minor' | ||
| - 'feature' | ||
| - 'feat' | ||
| - 'enhancement' | ||
| patch: | ||
| labels: | ||
| - 'patch' | ||
| - 'bug' | ||
| - 'fix' | ||
| - 'chore' | ||
| - 'refactor' | ||
| - 'style' | ||
| - 'test' | ||
| - 'ci' | ||
| default: patch | ||
|
|
||
| template: | | ||
| $CHANGES | ||
|
|
||
| --- | ||
| ### 💡 How to Release: | ||
| 1. Trigger the **Bump Version** workflow manually. Set the bump type to `auto` to use the version resolved above (`$RESOLVED_VERSION`), or set a specific override. This will create a version bump PR. | ||
| 2. Merge the version bump PR into `main`. | ||
| 3. Publish this draft release on GitHub. This will tag the commit and automatically build and publish the Docker images. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: Bump Version | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump_type: | ||
| description: "Bump Type (auto uses Release Drafter resolved version)" | ||
| required: true | ||
| default: "auto" | ||
| type: choice | ||
| options: | ||
| - "auto" | ||
| - "patch" | ||
| - "minor" | ||
| - "major" | ||
| - "custom" | ||
| custom_version: | ||
| description: "Custom Version (only used if Bump Type is 'custom', e.g. 1.4.0)" | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| bump_version: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Assert main branch | ||
| run: | | ||
| if [ "${{ github.ref }}" != "refs/heads/main" ]; then | ||
| echo "Error: This workflow must be run against the main branch (refs/heads/main); got ${{ github.ref }}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Resolve Version from Release Drafter | ||
| id: release_drafter | ||
| if: github.event.inputs.bump_type == 'auto' | ||
| uses: release-drafter/release-drafter@v6 | ||
| with: | ||
| config-name: release-drafter.yml | ||
| disable-releases: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Determine Target Version | ||
| id: determine_version | ||
| run: | | ||
| BUMP_TYPE="${{ github.event.inputs.bump_type }}" | ||
| CUSTOM_VERSION="${{ github.event.inputs.custom_version }}" | ||
| RESOLVED_VERSION="${{ steps.release_drafter.outputs.resolved_version }}" | ||
|
|
||
| if [ "$BUMP_TYPE" = "auto" ]; then | ||
| if [ -z "$RESOLVED_VERSION" ]; then | ||
| echo "Error: Release Drafter did not return a resolved version." >&2 | ||
| exit 1 | ||
| fi | ||
| echo "target_version=$RESOLVED_VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "Determined version: $RESOLVED_VERSION (via Release Drafter auto-resolve)" | ||
| elif [ "$BUMP_TYPE" = "custom" ]; then | ||
| if [ -z "$CUSTOM_VERSION" ]; then | ||
| echo "Error: Custom version must be provided if bump_type is 'custom'." >&2 | ||
| exit 1 | ||
| fi | ||
| echo "target_version=$CUSTOM_VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "Determined version: $CUSTOM_VERSION (via manual input)" | ||
| else | ||
| echo "target_version=$BUMP_TYPE" >> "$GITHUB_OUTPUT" | ||
| echo "Determined version: $BUMP_TYPE (via manual bump type)" | ||
| fi | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| bundler-cache: true | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v6 | ||
| with: | ||
| cache: true | ||
| cache_dependency_path: frontend/pnpm-lock.yaml | ||
| package_json_file: frontend/package.json | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: ".tool-versions" | ||
|
|
||
| - name: Install frontend dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| working-directory: frontend | ||
|
|
||
| - name: Perform Version Bump | ||
| id: perform_bump | ||
| run: | | ||
| bundle exec ruby bin/bump-version "${{ steps.determine_version.outputs.target_version }}" | ||
| NEW_VERSION=$(ruby -I. -e "require 'config/version'; puts Html2rss::Web::VERSION") | ||
| echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Regenerate OpenAPI spec and client | ||
| run: | | ||
| make openapi | ||
| make openapi-client | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.BUMP_VERSION_TOKEN || github.token }} | ||
| commit-message: "chore: bump version to v${{ steps.perform_bump.outputs.new_version }}" | ||
| branch: "bump-version/v${{ steps.perform_bump.outputs.new_version }}" | ||
| title: "chore: bump version to v${{ steps.perform_bump.outputs.new_version }}" | ||
| body: | | ||
| Automated version bump to `v${{ steps.perform_bump.outputs.new_version }}`. | ||
|
|
||
| This PR contains the version update in `config/version.rb` and regenerated OpenAPI specs and frontend API client. | ||
|
|
||
| ### 🚀 Next Steps | ||
| 1. Verify that all CI checks pass. | ||
| 2. Merge this Pull Request. | ||
| 3. Go to the draft release on GitHub and publish it. | ||
| assignees: ${{ github.actor }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Release Drafter | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| update_release_draft: | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
| runs-on: ubuntu-latest | ||
|
gildesmarais marked this conversation as resolved.
|
||
| steps: | ||
| - name: Draft next release | ||
| uses: release-drafter/release-drafter@v6 | ||
| with: | ||
| config-name: release-drafter.yml | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.