Skip to content

Commit 29fa686

Browse files
roncodesclaude
andcommitted
ci(release): tag automatically, and publish a GitHub Release at all
Three changes, on this working branch rather than a separate one as requested. Only these three files are staged — the in-progress addon edits are left alone. 1. release.yml delegates to the reusable workflow in fleetbase/fleetbase, which validates and pushes the tag when a dev-v* branch merges to main. The version is never retyped: it comes from the branch name, and the tag is refused unless composer.json, package.json, extension.json and RELEASE.md already agree with it. 2. create-release.yml is NEW. pallet was the only module without one, so tagging it published to npm and GitHub Packages and created no GitHub Release at all. Copied from the other modules, with body_path: RELEASE.md so the notes are the release body, matching fleetbase/fleetbase. 3. RELEASE.md is seeded, because the tag workflow refuses to release without notes whose first line names the version. Both placeholder markers must be replaced before a release will go through — that guard exists so the template itself can never be published as the release notes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent c33317b commit 29fa686

3 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
create:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Publish GitHub Release
13+
uses: softprops/action-gh-release@v2
14+
with:
15+
tag_name: ${{ github.ref_name }}
16+
name: ${{ github.ref_name }}
17+
body_path: RELEASE.md
18+
generate_release_notes: true
19+
draft: false
20+
prerelease: false
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Tag
2+
3+
# Tags a release when a `dev-v*` branch is merged to main, and pushes the tag. Delegates
4+
# to the reusable workflow in fleetbase/fleetbase. Requires org secret _GITHUB_AUTH_TOKEN
5+
# (inherited); no-ops with a warning until it is set.
6+
#
7+
# It pushes the tag and nothing else — create-release.yml and the publish jobs in this
8+
# repository already chain off `push: tags: v*`.
9+
#
10+
# The version is never retyped: it comes from the branch name, and the tag is refused
11+
# unless the files below and RELEASE.md already agree with it. This repository is
12+
# an ember addon plus a server, so it carries composer.json, package.json and extension.json.
13+
#
14+
# RELEASE.md is required, and its first line must name the version being released. That
15+
# check is the only thing that can tell notes written for this release from the previous
16+
# release's notes nobody replaced.
17+
#
18+
# Deliberately unpinned, like postman.yml — it tracks the reusable workflow on main, so
19+
# there is no ref here to remember to bump.
20+
#
21+
# workflow_dispatch is the recovery path. Use it when a release failed validation and the
22+
# fix landed on main after the merge: re-running the merge event would check out the
23+
# merge commit and never see that fix.
24+
25+
on:
26+
pull_request:
27+
types: [closed]
28+
branches: [main]
29+
workflow_dispatch:
30+
inputs:
31+
version:
32+
description: "Version to tag, e.g. 1.2.3. Recovery only — a normal release reads it from the branch."
33+
required: true
34+
permissions:
35+
contents: read
36+
37+
jobs:
38+
tag:
39+
if: github.event_name == 'workflow_dispatch' ||
40+
(github.event.pull_request.merged == true &&
41+
startsWith(github.event.pull_request.head.ref, 'dev-v'))
42+
uses: fleetbase/fleetbase/.github/workflows/release-tag.yml@main
43+
with:
44+
version-files: composer.json,package.json,extension.json
45+
version: ${{ github.event.inputs.version || '' }}
46+
secrets: inherit

RELEASE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
> v0.0.2 ~ "RELEASE_NOTES_PLACEHOLDER — replace this line with the release title"
2+
3+
---
4+
## Highlights
5+
6+
RELEASE_NOTES_PLACEHOLDER
7+
8+
Describe what changed in this release. The first line above must name the version
9+
being released, and both placeholder markers must be gone, or the release workflow
10+
refuses to tag.
11+
12+
---
13+
## Need help?
14+
- [GitHub Discussions](https://github.com/fleetbase/fleetbase/discussions)
15+
- [Discord](https://discord.gg/HnTqQ6zAVn)

0 commit comments

Comments
 (0)