CI: onboard breadarr onto the bakery distribution system
Adds bakery.toml (system_deps verified via ldd + Command::new grep against breadarrd/src, not guessed) and dev-release.yml/rc-release.yml/release.yml following bread-ecosystem's current single-trunk + RC-tag CI model. No GitHub Release step anywhere — this repo has no GitHub mirror.
This commit is contained in:
parent
7e1b7450cf
commit
3cbac5ffe9
4 changed files with 301 additions and 0 deletions
79
.forgejo/workflows/release.yml
Normal file
79
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ !contains(github.ref_name, '-rc.') }}
|
||||
runs-on: [self-hosted, hestia]
|
||||
steps:
|
||||
- name: checkout
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf src && mkdir src
|
||||
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
|
||||
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||
|
||||
- name: build
|
||||
run: cd src && cargo build --release --locked
|
||||
|
||||
- name: prepare artifacts
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
PKG_DIR="/srv/breadway-dl/breadarr/${VERSION}"
|
||||
mkdir -p "${PKG_DIR}"
|
||||
for bin in breadarrd breadarr-tui; do
|
||||
cp "src/target/release/${bin}" "${PKG_DIR}/${bin}-x86_64"
|
||||
strip "${PKG_DIR}/${bin}-x86_64"
|
||||
sha256sum "${PKG_DIR}/${bin}-x86_64" | awk '{print $1}' \
|
||||
> "${PKG_DIR}/${bin}-x86_64.sha256"
|
||||
done
|
||||
cp src/packaging/systemd/breadarrd.service "${PKG_DIR}/"
|
||||
cp src/bakery.toml "${PKG_DIR}/bakery.toml"
|
||||
ln -sfn "${VERSION}" "/srv/breadway-dl/breadarr/latest"
|
||||
|
||||
# Signs with the shared bakery ecosystem signing key (same key that
|
||||
# signs index.json). BAKERY_MINISIGN_SEC_KEY_PATH is a *path on this
|
||||
# runner's disk* (hestia has persistent storage), not the key
|
||||
# contents. Dormant (binaries ship unsigned) until that secret is
|
||||
# provisioned for this repo.
|
||||
- name: sign release binaries
|
||||
env:
|
||||
MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
PKG_DIR="/srv/breadway-dl/breadarr/${VERSION}"
|
||||
if [ -n "${MINISIGN_SEC_KEY:-}" ]; then
|
||||
for bin in breadarrd breadarr-tui; do
|
||||
minisign -W -S -s "${MINISIGN_SEC_KEY}" -m "${PKG_DIR}/${bin}-x86_64" \
|
||||
-x "${PKG_DIR}/${bin}-x86_64.minisig" </dev/null
|
||||
echo "signed ${bin}-x86_64"
|
||||
done
|
||||
else
|
||||
echo "::warning::BAKERY_MINISIGN_SEC_KEY_PATH not set — shipping breadarrd-x86_64/breadarr-tui-x86_64 UNSIGNED"
|
||||
fi
|
||||
|
||||
- name: regenerate index.json
|
||||
env:
|
||||
MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${MINISIGN_SEC_KEY:-}" ]; then
|
||||
echo "::error::BAKERY_MINISIGN_SEC_KEY_PATH secret not set — refusing to regenerate stable index.json unsigned (would leave a stale signature mismatched against fresh content and break bakery for everyone on the stable track)"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf /tmp/bread-ecosystem-ci-* 2>/dev/null || true
|
||||
# mktemp: a fixed clone path races when multiple repos' release
|
||||
# workflows run close together on the same self-hosted runner.
|
||||
ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)"
|
||||
git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}"
|
||||
bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh"
|
||||
rm -rf "${ECOSYSTEM_CI_DIR}"
|
||||
|
||||
# No GitHub Release upload step — breadarr has no GitHub mirror,
|
||||
# unlike most sibling bread-ecosystem repos. dl.breadway.dev is the
|
||||
# only distribution point for this repo.
|
||||
Loading…
Add table
Add a link
Reference in a new issue