fix(ci): name master builds after the release they follow
All checks were successful
Flatpak / flatpak (push) Successful in 20m44s

Every non-tag build called itself 0.0.0-dev+<hash>, a placeholder that
said nothing about which release it came after and put a `+` in the
bundle's download URL. A master build now uses `git describe`, as a
local checkout already does: 2.0.0-3-g21746b1 is three commits past
2.0.0. The placeholder remains only for history that has no tag yet.

Three more things the tag path needed before its first run. The
forgejo-release action takes the notes text in `release-notes` and a
path in `release-notes-file`; the workflow passed a path to the former,
so the release body would have been the file name. The tag filter is
spelled with globs so it reads the same as a workflow pattern or a plain
glob. Python, used to extract the notes from the metainfo, was only in
the container as somebody else's dependency and is now listed. The
2.0.0 entry carries the date it is tagged on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-10-03 15:41:57 +02:00
commit c7f984b95d
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
2 changed files with 16 additions and 5 deletions

View file

@ -16,7 +16,10 @@ on:
branches: [master] branches: [master]
push: push:
branches: [master] branches: [master]
tags: ['[0-9]+.[0-9]+.[0-9]+'] # Bare semver tags. Spelled with globs so it means the same whether the
# forge reads it as a workflow pattern or as a plain glob; `latest`, the
# rolling tag this workflow moves itself, does not start with a digit.
tags: ['[0-9]*.[0-9]*.[0-9]*']
workflow_dispatch: workflow_dispatch:
env: env:
@ -43,7 +46,7 @@ jobs:
pacman-key --init pacman-key --init
pacman-key --populate archlinux pacman-key --populate archlinux
pacman -Sy --noconfirm --needed archlinux-keyring pacman -Sy --noconfirm --needed archlinux-keyring
pacman -Syu --noconfirm --needed flatpak flatpak-builder ccache git nodejs jq gnupg go-yq ostree pacman -Syu --noconfirm --needed flatpak flatpak-builder ccache git nodejs jq gnupg go-yq ostree python
git config --global --add safe.directory '*' git config --global --add safe.directory '*'
- name: Sdk - name: Sdk
@ -74,7 +77,15 @@ jobs:
exit 1 exit 1
fi fi
else else
version="0.0.0-dev+$(git rev-parse --short HEAD)" # A master build names itself after the release it follows, the
# way a local checkout does: 2.0.0-3-g21746b1 is three commits
# past 2.0.0. Before the first tag there is nothing to describe
# from and the bare hash gets a placeholder in front.
described=$(git describe --tags --always --exclude=latest)
case "$described" in
[0-9]*.[0-9]*.[0-9]*) version="$described" ;;
*) version="0.0.0-dev+$described" ;;
esac
branch=beta branch=beta
fi fi
echo "version=$version" >> "$GITHUB_OUTPUT" echo "version=$version" >> "$GITHUB_OUTPUT"
@ -189,6 +200,6 @@ jobs:
repo: ${{ github.repository }} repo: ${{ github.repository }}
tag: ${{ github.ref_name }} tag: ${{ github.ref_name }}
title: crafter-build ${{ github.ref_name }} title: crafter-build ${{ github.ref_name }}
release-notes: release-notes.md release-notes-file: release-notes.md
release-dir: dist release-dir: dist
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -25,7 +25,7 @@
</provides> </provides>
<content_rating type="oars-1.1"/> <content_rating type="oars-1.1"/>
<releases> <releases>
<release version="2.0.0" date="2026-10-02"> <release version="2.0.0" date="2026-10-03">
<description> <description>
<p>First release distributed as a Flatpak, with a bundled LLVM 22 toolchain and WASI sysroot. Windows host support is removed; crafter-build gains --version and resolves its compiler from one place.</p> <p>First release distributed as a Flatpak, with a bundled LLVM 22 toolchain and WASI sysroot. Windows host support is removed; crafter-build gains --version and resolves its compiler from one place.</p>
</description> </description>