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:
parent
aefe07009b
commit
8c11bfd3b8
3 changed files with 17 additions and 37 deletions
|
|
@ -1,12 +1,11 @@
|
||||||
name: dev release
|
name: dev release
|
||||||
|
|
||||||
# Publishes a dev-track build on every push to `dev` —
|
# Publishes a dev-track build on every push to `main` (the trunk
|
||||||
# separate from release.yml's tag-triggered stable releases. See
|
# branch — there is no separate `dev` branch). See bread-ecosystem's
|
||||||
# bread-ecosystem's docs/release-channels.md for the three-track policy
|
# docs/release-channels.md for the release-track policy this is part of.
|
||||||
# this is part of.
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['dev']
|
branches: ['main']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -16,7 +15,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
|
||||||
|
|
@ -36,7 +35,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
|
||||||
|
|
@ -78,6 +77,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 --branch main https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}"
|
||||||
TRACK=dev bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh"
|
TRACK=dev bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh"
|
||||||
rm -rf "${ECOSYSTEM_CI_DIR}"
|
rm -rf "${ECOSYSTEM_CI_DIR}"
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,23 @@
|
||||||
name: beta release
|
name: beta (rc) release
|
||||||
|
|
||||||
# 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
|
||||||
# stabilization branch cut from `dev` when ready to stabilize; only
|
# pushed to `main` — there is no separate `beta` branch; "freezing" is
|
||||||
# fix/<issue> branches merged into `beta` should land here afterward.
|
# just pausing pushes to main while an RC gets tested. See
|
||||||
# See bread-ecosystem's docs/release-channels.md for the three-track policy.
|
# bread-ecosystem's docs/release-channels.md for the release-track policy.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['beta']
|
tags: ['v*']
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -25,31 +26,10 @@ jobs:
|
||||||
- name: test
|
- name: test
|
||||||
run: cd src && cargo test --release --locked --workspace --features full
|
run: cd src && cargo test --release --locked --workspace --features full
|
||||||
|
|
||||||
- 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' breadsearch/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/breadsearch/${VERSION}"
|
PKG_DIR="/srv/breadway-dl/beta/breadsearch/${VERSION}"
|
||||||
mkdir -p "${PKG_DIR}"
|
mkdir -p "${PKG_DIR}"
|
||||||
for bin in breadsearch breadmill; do
|
for bin in breadsearch breadmill; do
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue