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
3 changes: 0 additions & 3 deletions .github/.release-please-manifest.json

This file was deleted.

56 changes: 56 additions & 0 deletions .github/release-drafter.yml
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.
19 changes: 0 additions & 19 deletions .github/release-please-config.json

This file was deleted.

127 changes: 127 additions & 0 deletions .github/workflows/bump-version.yml
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

Comment thread
gildesmarais marked this conversation as resolved.
- 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 }}
29 changes: 0 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,8 @@ jobs:

openapi:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
token: ${{ startsWith(github.head_ref, 'release-please--') && secrets.RELEASE_PLEASE_TOKEN || github.token }}
ref: ${{ startsWith(github.head_ref, 'release-please--') && github.head_ref || github.sha }}
fetch-depth: 0

- uses: ruby/setup-ruby@v1
with:
Expand All @@ -88,30 +82,7 @@ jobs:
working-directory: frontend

- name: Verify generated OpenAPI spec and client are up to date
id: verify
run: make openapi-verify
continue-on-error: ${{ startsWith(github.head_ref, 'release-please--') }}

- name: Regenerate and commit OpenAPI artifacts on release PRs
if: steps.verify.outcome == 'failure' && startsWith(github.head_ref, 'release-please--')
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

make openapi
make openapi-client

git add public/openapi.yaml frontend/src/api/generated/

if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: regenerate openapi spec and client for version bump"
git push origin ${{ github.head_ref }}

echo "## OpenAPI artifacts regenerated" >> "$GITHUB_STEP_SUMMARY"
echo "Version bump detected; OpenAPI spec and frontend client have been regenerated and committed." >> "$GITHUB_STEP_SUMMARY"
fi

- name: Lint OpenAPI contract
run: make openapi-lint
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/release-drafter.yml
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
Comment thread
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 }}
Loading
Loading