ci: make beta a branch-triggered freeze track, not a one-off tag
Beta is now a real stabilization branch: publishes on every push to `beta` (mirroring dev's model, auto-versioned X.Y.Z-beta.<ts>+<sha>, base version from the latest published tag) instead of a manual beta-v* tag. Fixes made during the freeze land via fix/<issue> branches merged into `beta` directly. The gen-index.sh clone for beta pulls bread-ecosystem's default branch (main) rather than pinning to dev, since beta is the more stable track and main now carries the TRACK-aware script.
This commit is contained in:
parent
fa3ccacca5
commit
eb8667991d
1 changed files with 31 additions and 10 deletions
|
|
@ -1,12 +1,12 @@
|
|||
name: beta release
|
||||
|
||||
# Publishes a beta-track build when a `beta-v*` tag is pushed —
|
||||
# separate from release.yml's tag-triggered stable releases. See
|
||||
# bread-ecosystem's docs/release-channels.md for the three-track policy
|
||||
# this is part of.
|
||||
# Publishes a beta-track build on every push to `beta` — a frozen
|
||||
# stabilization branch cut from `dev` when ready to stabilize; only
|
||||
# fix/<issue> branches merged into `beta` should land here afterward.
|
||||
# See bread-ecosystem's docs/release-channels.md for the three-track policy.
|
||||
on:
|
||||
push:
|
||||
tags: ['beta-v*']
|
||||
branches: ['beta']
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf src && mkdir src
|
||||
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
|
||||
git clone --branch beta --depth 1 \
|
||||
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||
|
||||
- name: build
|
||||
|
|
@ -25,10 +25,31 @@ jobs:
|
|||
- name: test
|
||||
run: cd src && cargo test --release --locked
|
||||
|
||||
- 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
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${GITHUB_REF_NAME#beta-v}"
|
||||
PKG_DIR="/srv/breadway-dl/beta/breadpaper/${VERSION}"
|
||||
mkdir -p "${PKG_DIR}"
|
||||
cp "src/target/release/breadpaper" "${PKG_DIR}/breadpaper-x86_64"
|
||||
|
|
@ -38,8 +59,8 @@ jobs:
|
|||
cp src/bakery.toml "${PKG_DIR}/bakery.toml"
|
||||
ln -sfn "${VERSION}" "/srv/breadway-dl/beta/breadpaper/latest"
|
||||
|
||||
# No GitHub Release upload — beta, like the other non-stable track,
|
||||
# is only distributed via dl.breadway.dev/beta/.
|
||||
# No GitHub Release upload — beta, like dev, is only distributed via
|
||||
# dl.breadway.dev/beta/.
|
||||
- name: regenerate beta index.json
|
||||
env:
|
||||
MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }}
|
||||
|
|
@ -53,6 +74,6 @@ jobs:
|
|||
# mktemp: a fixed clone path races when multiple repos' dev/beta
|
||||
# workflows run close together on the same self-hosted runner.
|
||||
ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)"
|
||||
git clone --branch dev https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}"
|
||||
git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}"
|
||||
TRACK=beta bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh"
|
||||
rm -rf "${ECOSYSTEM_CI_DIR}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue