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
71 changes: 71 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Release Drafter configuration.
#
# Categories are keyed on this project's type labels (enhancement / bug /
# chore / documentation); the autolabeler classifies Conventional-Commit PR
# titles into them so the draft is categorized without manual labelling.
#
# Scope labels (phase-1/2/3, scaffolding) are deliberately NOT category or
# exclude labels — they are ignored by the changelog. Listing them under
# exclude-labels would drop nearly every PR; they simply don't drive a
# category.
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
template: |
# What Changed 👀

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 🚀 Features
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📄 Documentation
labels:
- documentation
- title: 🔧 Maintenance
labels:
- chore
- title: 🧩 Dependency Updates
labels:
- dependencies
collapse-after: 5
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- breaking
minor:
labels:
- enhancement
patch:
labels:
- bug
- chore
- documentation
- dependencies
default: patch
exclude-labels:
- skip-changelog
# Classify Conventional-Commit PR titles into the type labels above. The
# breaking rule matches the CC "!" marker (e.g. feat!: / fix(x)!:).
autolabeler:
- label: breaking
title:
- '/^[a-z]+(\(.+\))?!:/i'
- label: enhancement
title:
- '/^feat(\(.+\))?!?:/i'
- label: bug
title:
- '/^fix(\(.+\))?!?:/i'
- label: documentation
title:
- '/^docs(\(.+\))?!?:/i'
- label: chore
title:
- '/^(chore|build|ci|refactor|perf|test|style|revert)(\(.+\))?!?:/i'
77 changes: 77 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release Drafter

# Drafts the next release on push to main and updates CHANGELOG.md before the
# release is cut; autolabels PRs so the draft is categorized.
#
# DISABLED until the org GitHub App is configured: every job is gated on
# `vars.APP_CLIENT_ID`, so until that variable is set the job is skipped (no
# runs, no failures). Once APP_CLIENT_ID (variable) and APP_PRIVATE_KEY
# (secret) are set for the org/repo, it self-enables — no edit required.
#
# The App token is used to push the CHANGELOG commit back to main. That commit
# touches only CHANGELOG.md (path-ignored by ci-go/ci-image) and carries
# [skip ci], so it never triggers the image build or re-triggers this workflow.

on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
draft:
name: Draft release and update changelog
# Inert until the GitHub App is configured (see header).
if: ${{ vars.APP_CLIENT_ID != '' }}
runs-on: ubuntu-latest
permissions:
contents: write # update releases + push the changelog commit
pull-requests: write # autolabeler
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v3.1.1
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0

- name: Release Drafter
id: drafter
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Update CHANGELOG
if: github.event_name != 'pull_request'
uses: Bugs5382/changelog-updater-action@v0.3.2
env:
LOG_LEVEL: debug
LOG_FORMAT: text
RELEASE_NOTES: >-
${{ steps.drafter.outputs.body }}
RELEASE_VERSION: v${{ steps.drafter.outputs.resolved_version }}
with:
tag: ${{ env.RELEASE_VERSION }}
notes: ${{ env.RELEASE_NOTES }}
diff: "true"

- name: Commit changelog
if: github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore(pre-release): v${{ steps.drafter.outputs.resolved_version }} [skip ci]"
file_pattern: CHANGELOG.md
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).