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
18 changes: 14 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: release

# Pushing a tag v<version> publishes a GitHub release with that version's section of CHANGELOG.md.
# Running it by hand (workflow_dispatch) on main does the same for the version in plugin.json, creating the tag
# v<version> on the run's commit; it fails when that tag already exists.
on:
push:
tags: ["v*"]
workflow_dispatch:

permissions:
contents: write
Expand All @@ -15,14 +18,21 @@ jobs:
- uses: actions/checkout@v4
- name: the tag matches plugin.json
run: |
v="${GITHUB_REF_NAME#v}"
p=$(python3 -c "import json; print(json.load(open('plugins/beanfx/.claude-plugin/plugin.json'))['version'])")
[ "$v" = "$p" ] || { echo "tag $GITHUB_REF_NAME but plugin.json says $p"; exit 1; }
if [ "$GITHUB_REF_TYPE" = tag ]; then
tag="$GITHUB_REF_NAME"
[ "${tag#v}" = "$p" ] || { echo "tag $tag but plugin.json says $p"; exit 1; }
else
[ "$GITHUB_REF_NAME" = main ] || { echo "run it on main, not $GITHUB_REF_NAME"; exit 1; }
tag="v$p"
if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then echo "$tag exists"; exit 1; fi
fi
echo "TAG=$tag" >> "$GITHUB_ENV"
- name: notes from CHANGELOG.md
run: |
v="${GITHUB_REF_NAME#v}"
v="${TAG#v}"
awk -v v="$v" '/^## /{on = ($2 == v)} on' CHANGELOG.md | tail -n +2 > notes.md
[ -s notes.md ] || { echo "CHANGELOG.md has no section for $v"; exit 1; }
- run: gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file notes.md
- run: gh release create "$TAG" --target "$GITHUB_SHA" --title "$TAG" --notes-file notes.md
env:
GH_TOKEN: ${{ github.token }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The phases knob: how a cast's time splits, with timing recommendations (2026-11-
cinematic) with seconds and frames, an ASCII timeline, and timing recommendations (wind-up at least 3 frames and
a short hold, a 1 to 2 frame release, travel from distance over speed, player skills under about 1 s to the
impact, longer tells for enemies). The split goes into `Spec.windup` and `Spec.poses`. The gate now has 18 knobs.
- The release workflow also runs by hand on `main`: it creates the tag `v<version>` from `plugin.json` and
publishes the release, for when tags cannot be pushed (`CONTRIBUTING.md`).

## 2.3.0

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ add one only when a page links it, and remove one that nothing links any more. C
2. Set the same version in `plugins/beanfx/.claude-plugin/plugin.json`.
3. Merge to `main`, then `git tag v<version> && git push origin v<version>`. The release workflow checks the tag
against `plugin.json` and publishes a GitHub release with that section of the changelog.
Where tags cannot be pushed, run the release workflow by hand on `main` (Actions, release, Run workflow): it
creates the tag `v<version>` from `plugin.json` on that commit and publishes the same release.
Loading