Skip to content

Commit 7db83ee

Browse files
authored
ci: draft releases with GITHUB_TOKEN and drop the CHANGELOG (#372)
Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com> Co-authored-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
1 parent 6bd5eae commit 7db83ee

4 files changed

Lines changed: 18 additions & 70 deletions

File tree

‎.github/CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This repository follows the Bugs5382 standard workflow.
1414
4. Open a PR with a Conventional Commit title. The autolabeler sets the category label
1515
from the title; fill the PR template, reference the issue (`Closes #N`), and add a
1616
closing summary before merge.
17-
5. PRs merge by squash. On merge, release-drafter drafts the next notes and the changelog
18-
updates on `main`; the maintainer publishes releases manually.
17+
5. PRs merge by squash. On merge, release-drafter drafts the next release notes; the
18+
maintainer publishes releases manually.
1919

2020
Keep one concern per PR, even small ones. When editing GitHub Actions workflows, a job id must be a
2121
plain identifier (a letter or `_`, then alphanumerics/`-`/`_`); put emoji and display text in the
Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
name: Release Drafter
22

3-
# Drafts the next release on push to main and updates CHANGELOG.md before the
4-
# release is cut; autolabels PRs so the draft is categorized.
5-
#
6-
# DISABLED until the org GitHub App is configured: every job is gated on
7-
# `vars.APP_CLIENT_ID`, so until that variable is set the job is skipped (no
8-
# runs, no failures). Once APP_CLIENT_ID (variable) and APP_PRIVATE_KEY
9-
# (secret) are set for the org/repo, it self-enables — no edit required.
10-
#
11-
# The App token is used to push the CHANGELOG commit back to main. That commit
12-
# touches only CHANGELOG.md (path-ignored by ci-go) and carries [skip ci], so
13-
# it never re-triggers this workflow.
3+
# Drafts the next release on push to main; autolabels PRs so the draft is
4+
# categorized. Runs with the built-in GITHUB_TOKEN, no org GitHub App
5+
# required.
146

157
on:
168
push:
@@ -30,55 +22,24 @@ concurrency:
3022

3123
jobs:
3224
draft:
33-
name: Draft release and update changelog
34-
# Inert until the GitHub App is configured (see header).
35-
if: ${{ vars.APP_CLIENT_ID != '' && github.event.pull_request.draft != true }}
25+
name: Draft release
26+
if: ${{ github.event.pull_request.draft != true }}
3627
runs-on: ubuntu-latest
3728
timeout-minutes: 10
3829
permissions:
39-
contents: write # update releases + push the changelog commit
40-
pull-requests: write # autolabeler
30+
contents: write
31+
pull-requests: write
4132
steps:
42-
- name: Create GitHub App token
43-
id: app-token
44-
uses: actions/create-github-app-token@v3.1.1
45-
with:
46-
client-id: ${{ vars.APP_CLIENT_ID }}
47-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
48-
4933
- name: Checkout
5034
uses: actions/checkout@v4
5135
with:
52-
token: ${{ steps.app-token.outputs.token }}
5336
fetch-depth: 0
5437

5538
- name: Release Drafter
56-
id: drafter
5739
uses: Bugs5382/release-drafter-action@de0c4559d69039b8b371ef951b62a2532ad3593f # v1.0.1
5840
with:
59-
token: ${{ steps.app-token.outputs.token }}
41+
token: ${{ secrets.GITHUB_TOKEN }}
6042
extends: CryptOS-PKI/.github@aa8761a2903d759dbb5f48b8d5e3517a9dc6da79
6143
first-version: 0.1.0
6244
prerelease: true
6345
prerelease-identifier: rc
64-
65-
- name: Update CHANGELOG
66-
if: github.event_name != 'pull_request'
67-
uses: Bugs5382/changelog-updater-action@v0.3.2
68-
env:
69-
LOG_LEVEL: debug
70-
LOG_FORMAT: text
71-
RELEASE_NOTES: >-
72-
${{ steps.drafter.outputs.body }}
73-
RELEASE_VERSION: v${{ steps.drafter.outputs.resolved_version }}
74-
with:
75-
tag: ${{ env.RELEASE_VERSION }}
76-
notes: ${{ env.RELEASE_NOTES }}
77-
diff: "true"
78-
79-
- name: Commit changelog
80-
if: github.event_name != 'pull_request'
81-
uses: stefanzweifel/git-auto-commit-action@v4
82-
with:
83-
commit_message: "chore(pre-release): v${{ steps.drafter.outputs.resolved_version }} [skip ci]"
84-
file_pattern: CHANGELOG.md

‎CHANGELOG.md‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎CLAUDE.md‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ the governance below is shared across all repos created that way.
3434
- Verify with evidence, not assertions: run the real check for what changed (lint, a full
3535
template/build render, `actionlint` for workflows) before calling it done. Green CI is necessary,
3636
not sufficient.
37-
- One concern per branch/PR, even tiny ones — it keeps reviews and the drafted changelog clean.
37+
- One concern per branch/PR, even tiny ones — it keeps reviews and the draft release notes clean.
3838
- When PRs interact, state an explicit merge ORDER rather than opening them and walking away:
3939
anything a *tag* triggers needs its inputs on `main` first; a new *gate* (check) needs the
4040
violations it catches fixed first; a workflow that builds from committed content needs that
@@ -52,26 +52,19 @@ issue with ordered **sub-issues** -> put it on the active **milestone** -> branc
5252
(the autolabeler sets the category label from the title), the template body, and a **closing
5353
summary** before merge -> **squash** merge. The operator (@CryptOS-PKI) is the assignee.
5454

55-
On merge, release-drafter drafts the next notes by label and `CHANGELOG.md` updates on `main` via the
56-
changelog action -- **nothing tags automatically**. When the first push to main resolves the version,
57-
rename the milestone to that version. The maintainer then **manually publishes the GitHub Release**,
58-
which creates the tag with the finalized changelog (and triggers the publish where the repo ships a
59-
package).
55+
On merge, release-drafter drafts the next notes by label -- **nothing tags automatically**. When
56+
the first push to main resolves the version, rename the milestone to that version. The maintainer
57+
then **manually publishes the GitHub Release**, which creates the tag with the drafted notes (and
58+
triggers the publish where the repo ships a package).
6059

6160
Keep public artifacts (issues, PRs, commit messages) free of references to local-only design notes.
6261

6362
## Releasing
6463

65-
On every push to `main` the **Release Manager** workflow (`.github/workflows/job-version-bump.yaml`)
66-
runs: release-drafter anticipates the next version, the manifest version is bumped (package
67-
ecosystems only), `CHANGELOG.md` is updated via the changelog action, and a
68-
`chore(pre-release): vX [skip ci]` commit is pushed back to `main`. **Nothing tags automatically.**
64+
On every push to `main` the **Release Drafter** workflow (`.github/workflows/release-drafter.yml`)
65+
drafts the next release notes using the built-in `GITHUB_TOKEN`. **Nothing tags automatically.**
6966
The maintainer then publishes the GitHub Release by hand, which creates the `vX.Y.Z` tag with the
70-
finalized changelog and triggers the publish workflow where the repo ships a package.
71-
72-
The Release Manager pushes to `main` through the release GitHub App, which the branch ruleset
73-
(`governance/rulesets/branch-default.json`) lists as a bypass actor — without that bypass the
74-
`[skip ci]` commit would be rejected by the PR-required rule.
67+
drafted notes and triggers the publish workflow where the repo ships a package.
7568

7669
**GitHub Action repos release differently** — a composite/JS action has no package manifest and is
7770
**not** published to a registry. The maintainer manually tags `vX.Y.Z`, publishes the GitHub

0 commit comments

Comments
 (0)