Skip to content
Closed
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
35 changes: 26 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Compile and release

on:
# Releases are cut on merges into main and on dev_* tags (auto-versioned
# below, like rehosting/penguin). NOTE: we deliberately do NOT trigger on
# 'v*' tags — the release step now *creates* v* tags via version-increment,
# so a 'v*' push trigger would make every release re-trigger itself.
# below). NOTE: we deliberately do NOT trigger on 'v*' tags — the release
# step itself *creates* v* tags, so a 'v*' push trigger would make every
# release re-trigger itself.
push:
branches:
- main
Expand Down Expand Up @@ -321,14 +321,31 @@ jobs:
done
tar -czvf kernel-devel-all.tar.gz -C kernel-devel-all .

# Auto-version like rehosting/penguin: query the GitHub API for the latest
# release and increment. On main this yields a clean vX.Y.Z; on a non-main
# ref (a dev_* tag) version-increment appends a -pre suffix.
# Auto-version: continue the v3.6.x line monotonically. We compute the
# next patch deterministically from the existing v3.6.* tags rather than
# using reecetech/version-increment, whose base detection mis-derived
# v3.3.11 from the legacy v3.5.x-beta tag history. First release is
# v3.6.1; each subsequent release bumps the patch (v3.6.2, v3.6.3, ...).
# To start a new minor line later, bump MAJOR_MINOR below.
- name: Get next version
id: version
uses: reecetech/version-increment@2023.10.1
with:
use_api: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
MAJOR_MINOR="3.6"
latest_patch=$(gh api \
"repos/${GITHUB_REPOSITORY}/git/matching-refs/tags/v${MAJOR_MINOR}." \
--jq '.[].ref' 2>/dev/null \
| sed -E "s#refs/tags/v${MAJOR_MINOR}\.##" \
| grep -E '^[0-9]+$' | sort -n | tail -1 || true)
if [ -z "${latest_patch}" ]; then
NEXT="v${MAJOR_MINOR}.1"
else
NEXT="v${MAJOR_MINOR}.$((latest_patch + 1))"
fi
echo "v-version=${NEXT}" >> "$GITHUB_OUTPUT"
echo "Next version: ${NEXT}"

- name: Create and publish release
# Only publish on real release events (main merge / dev_* tag). A manual
Expand Down
Loading