CI: single-trunk model — dev triggers on main, beta becomes RC-tag-triggered

Replaces the dev/beta branch split with one trunk (main): dev-track
builds still publish on every push, but the beta track now publishes
from a vX.Y.Z-rc.N prerelease tag instead of a separately-maintained
beta branch. Removes the branch nobody reliably kept in sync.
This commit is contained in:
Breadway 2026-07-31 11:05:17 +08:00
parent f8f69f4ae5
commit 3caad809a3
6 changed files with 32 additions and 75 deletions

View file

@ -1,11 +1,11 @@
name: dev bakery name: dev bakery
# Publishes a dev-track build on every push to `dev` — separate from # Publishes a dev-track build on every push to `main` (the trunk branch —
# release-bakery.yml's tag-triggered stable releases. See docs/release-channels.md # there is no separate `dev` branch). See docs/release-channels.md for the
# for the three-track policy (stable/beta/dev) this is part of. # release-track policy this is part of.
on: on:
push: push:
branches: ['dev'] branches: ['main']
paths: paths:
- 'bakery/**' - 'bakery/**'
- 'Cargo.toml' - 'Cargo.toml'
@ -20,7 +20,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
rm -rf src && mkdir src rm -rf src && mkdir src
git clone --branch dev --depth 1 \ git clone --branch main --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
- name: build - name: build
@ -45,7 +45,7 @@ jobs:
# what's already installed and bakery would correctly refuse it. # what's already installed and bakery would correctly refuse it.
LATEST_TAG="$(git ls-remote --tags --refs \ LATEST_TAG="$(git ls-remote --tags --refs \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \ "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \
| awk -F/ '{print $NF}' | sed 's/^v//' | sort -V | tail -1)" | awk -F/ '{print $NF}' | sed 's/^v//' | (grep -v -- '-' || true) | sort -V | tail -1)"
if [ -n "${LATEST_TAG}" ]; then if [ -n "${LATEST_TAG}" ]; then
CUR="${LATEST_TAG}" CUR="${LATEST_TAG}"
else else

View file

@ -1,11 +1,11 @@
name: dev bread-theme name: dev bread-theme
# Publishes a dev-track build on every push to `dev` — separate from # Publishes a dev-track build on every push to `main` (the trunk branch —
# release-bread-theme.yml's tag-triggered stable releases. See # there is no separate `dev` branch). See docs/release-channels.md for the
# docs/release-channels.md for the three-track policy this is part of. # release-track policy this is part of.
on: on:
push: push:
branches: ['dev'] branches: ['main']
paths: paths:
- 'bread-theme/**' - 'bread-theme/**'
- 'Cargo.toml' - 'Cargo.toml'
@ -20,7 +20,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
rm -rf src && mkdir src rm -rf src && mkdir src
git clone --branch dev --depth 1 \ git clone --branch main --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
- name: build - name: build
@ -37,7 +37,7 @@ jobs:
# what's already installed and bakery would correctly refuse it. # what's already installed and bakery would correctly refuse it.
LATEST_TAG="$(git ls-remote --tags --refs \ LATEST_TAG="$(git ls-remote --tags --refs \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \ "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \
| awk -F/ '{print $NF}' | sed 's/^v//' | sort -V | tail -1)" | awk -F/ '{print $NF}' | sed 's/^v//' | (grep -v -- '-' || true) | sort -V | tail -1)"
if [ -n "${LATEST_TAG}" ]; then if [ -n "${LATEST_TAG}" ]; then
CUR="${LATEST_TAG}" CUR="${LATEST_TAG}"
else else

View file

@ -1,12 +1,12 @@
name: beta bakery name: beta (rc) bakery
# Publishes a beta-track build on every push to `beta` — a frozen # Publishes a beta-track build for any `vX.Y.Z-rc.N` prerelease tag pushed
# stabilization branch cut from `dev` when ready to stabilize; only # to `main` — there is no separate `beta` branch; "freezing" is just
# fix/<issue> branches merged into `beta` should land here afterward. # pausing pushes to main while an RC gets tested. See
# See docs/release-channels.md for the three-track policy (stable/beta/dev). # docs/release-channels.md for the release-track policy.
on: on:
push: push:
branches: ['beta'] tags: ['v*']
paths: paths:
- 'bakery/**' - 'bakery/**'
- 'Cargo.toml' - 'Cargo.toml'
@ -15,13 +15,14 @@ on:
jobs: jobs:
build: build:
if: ${{ contains(github.ref_name, '-rc.') }}
runs-on: [self-hosted, hestia] runs-on: [self-hosted, hestia]
steps: steps:
- name: checkout - name: checkout
run: | run: |
set -euo pipefail set -euo pipefail
rm -rf src && mkdir src rm -rf src && mkdir src
git clone --branch beta --depth 1 \ git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
- name: build - name: build
@ -30,36 +31,10 @@ jobs:
- name: test - name: test
run: cd src && cargo test --release --locked -p bakery run: cd src && cargo test --release --locked -p bakery
# Auto-bumps the patch version from the latest tag and appends a
# timestamp+sha beta suffix — no developer discipline required, and the
# result is visibly "ahead of" the last stable patch release while
# staying valid semver (comparable within the beta track by bakery's
# `is_newer`).
- name: compute beta version
run: |
set -euo pipefail
cd src
# Base the beta version off the latest published stable tag,
# not Cargo.toml — Cargo.toml can go stale relative to the last
# real release (seen in practice: breadbox/breadpad/breadcrumbs/
# breadpaper), which would make a beta build sort as OLDER than
# what's already installed and bakery would correctly refuse it.
LATEST_TAG="$(git ls-remote --tags --refs \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \
| awk -F/ '{print $NF}' | sed 's/^v//' | sort -V | tail -1)"
if [ -n "${LATEST_TAG}" ]; then
CUR="${LATEST_TAG}"
else
CUR="$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/')"
fi
IFS='.' read -r MA MI PA <<< "${CUR}"
SHA="$(git rev-parse --short HEAD)"
TS="$(date -u +%Y%m%d%H%M%S)"
echo "VERSION=${MA}.${MI}.$((PA + 1))-beta.${TS}+${SHA}" >> "$GITHUB_ENV"
- name: prepare artifacts - name: prepare artifacts
run: | run: |
set -euo pipefail set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="/srv/breadway-dl/beta/bakery/${VERSION}" PKG_DIR="/srv/breadway-dl/beta/bakery/${VERSION}"
mkdir -p "${PKG_DIR}" mkdir -p "${PKG_DIR}"
cp "src/target/release/bakery" "${PKG_DIR}/bakery-x86_64" cp "src/target/release/bakery" "${PKG_DIR}/bakery-x86_64"

View file

@ -1,12 +1,12 @@
name: beta bread-theme name: beta (rc) bread-theme
# Publishes a beta-track build on every push to `beta` — a frozen # Publishes a beta-track build for any `vX.Y.Z-rc.N` prerelease tag pushed
# stabilization branch cut from `dev` when ready to stabilize; only # to `main` — there is no separate `beta` branch; "freezing" is just
# fix/<issue> branches merged into `beta` should land here afterward. # pausing pushes to main while an RC gets tested. See
# See docs/release-channels.md for the three-track policy this is part of. # docs/release-channels.md for the release-track policy.
on: on:
push: push:
branches: ['beta'] tags: ['v*']
paths: paths:
- 'bread-theme/**' - 'bread-theme/**'
- 'Cargo.toml' - 'Cargo.toml'
@ -15,43 +15,23 @@ on:
jobs: jobs:
build: build:
if: ${{ contains(github.ref_name, '-rc.') }}
runs-on: [self-hosted, hestia] runs-on: [self-hosted, hestia]
steps: steps:
- name: checkout - name: checkout
run: | run: |
set -euo pipefail set -euo pipefail
rm -rf src && mkdir src rm -rf src && mkdir src
git clone --branch beta --depth 1 \ git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
- name: build - name: build
run: cd src && cargo build --release --locked -p bread-theme --bin bread-theme run: cd src && cargo build --release --locked -p bread-theme --bin bread-theme
- name: compute beta version
run: |
set -euo pipefail
cd src
# Base the beta version off the latest published stable tag,
# not Cargo.toml — Cargo.toml can go stale relative to the last
# real release (seen in practice: breadbox/breadpad/breadcrumbs/
# breadpaper), which would make a beta build sort as OLDER than
# what's already installed and bakery would correctly refuse it.
LATEST_TAG="$(git ls-remote --tags --refs \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" 'v*' \
| awk -F/ '{print $NF}' | sed 's/^v//' | sort -V | tail -1)"
if [ -n "${LATEST_TAG}" ]; then
CUR="${LATEST_TAG}"
else
CUR="$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/')"
fi
IFS='.' read -r MA MI PA <<< "${CUR}"
SHA="$(git rev-parse --short HEAD)"
TS="$(date -u +%Y%m%d%H%M%S)"
echo "VERSION=${MA}.${MI}.$((PA + 1))-beta.${TS}+${SHA}" >> "$GITHUB_ENV"
- name: prepare artifacts - name: prepare artifacts
run: | run: |
set -euo pipefail set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="/srv/breadway-dl/beta/bread-theme/${VERSION}" PKG_DIR="/srv/breadway-dl/beta/bread-theme/${VERSION}"
mkdir -p "${PKG_DIR}" mkdir -p "${PKG_DIR}"
cp "src/target/release/bread-theme" "${PKG_DIR}/bread-theme-x86_64" cp "src/target/release/bread-theme" "${PKG_DIR}/bread-theme-x86_64"

View file

@ -6,6 +6,7 @@ on:
jobs: jobs:
build: build:
if: ${{ !contains(github.ref_name, '-rc.') }}
runs-on: [self-hosted, hestia] runs-on: [self-hosted, hestia]
steps: steps:
- name: checkout - name: checkout

View file

@ -6,6 +6,7 @@ on:
jobs: jobs:
build: build:
if: ${{ !contains(github.ref_name, '-rc.') }}
runs-on: [self-hosted, hestia] runs-on: [self-hosted, hestia]
steps: steps:
- name: checkout - name: checkout