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
70bb804883
commit
56aecfcbd6
1 changed files with 31 additions and 10 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
name: beta release
|
name: beta release
|
||||||
|
|
||||||
# Publishes a beta-track build when a `beta-v*` tag is pushed —
|
# Publishes a beta-track build on every push to `beta` — a frozen
|
||||||
# separate from release.yml's tag-triggered stable releases. See
|
# stabilization branch cut from `dev` when ready to stabilize; only
|
||||||
# bread-ecosystem's docs/release-channels.md for the three-track policy
|
# fix/<issue> branches merged into `beta` should land here afterward.
|
||||||
# this is part of.
|
# See bread-ecosystem's docs/release-channels.md for the three-track policy.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['beta-v*']
|
branches: ['beta']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -16,16 +16,37 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
rm -rf src && mkdir src
|
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
|
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: cd src && cargo build --release --locked
|
run: cd src && cargo build --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
|
- name: prepare artifacts
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
VERSION="${GITHUB_REF_NAME#beta-v}"
|
|
||||||
PKG_DIR="/srv/breadway-dl/beta/breadshot/${VERSION}"
|
PKG_DIR="/srv/breadway-dl/beta/breadshot/${VERSION}"
|
||||||
mkdir -p "${PKG_DIR}"
|
mkdir -p "${PKG_DIR}"
|
||||||
cp "src/target/release/breadshot" "${PKG_DIR}/breadshot-x86_64"
|
cp "src/target/release/breadshot" "${PKG_DIR}/breadshot-x86_64"
|
||||||
|
|
@ -35,8 +56,8 @@ jobs:
|
||||||
cp src/bakery.toml "${PKG_DIR}/bakery.toml"
|
cp src/bakery.toml "${PKG_DIR}/bakery.toml"
|
||||||
ln -sfn "${VERSION}" "/srv/breadway-dl/beta/breadshot/latest"
|
ln -sfn "${VERSION}" "/srv/breadway-dl/beta/breadshot/latest"
|
||||||
|
|
||||||
# No GitHub Release upload — beta, like the other non-stable track,
|
# No GitHub Release upload — beta, like dev, is only distributed via
|
||||||
# is only distributed via dl.breadway.dev/beta/.
|
# dl.breadway.dev/beta/.
|
||||||
- name: regenerate beta index.json
|
- name: regenerate beta index.json
|
||||||
env:
|
env:
|
||||||
MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }}
|
MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }}
|
||||||
|
|
@ -50,6 +71,6 @@ jobs:
|
||||||
# mktemp: a fixed clone path races when multiple repos' dev/beta
|
# mktemp: a fixed clone path races when multiple repos' dev/beta
|
||||||
# workflows run close together on the same self-hosted runner.
|
# workflows run close together on the same self-hosted runner.
|
||||||
ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)"
|
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"
|
TRACK=beta bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh"
|
||||||
rm -rf "${ECOSYSTEM_CI_DIR}"
|
rm -rf "${ECOSYSTEM_CI_DIR}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue