bread-ecosystem/.github/workflows/release.yml
Breadway 6b5f4f475f Fix release pipeline: bakery.toml discovery and ECOSYSTEM_DIR on hestia
- Add bakery.toml describing the bakery binary as an installable product
- gen-index.sh: check DL_DIR/<pkg>/bakery.toml first (written by each
  product's release workflow), fall back to sibling checkout for local dev
- gen-index.sh: include bakery itself in the products list
- release.yml: use GITHUB_WORKSPACE instead of ECOSYSTEM_DIR (the
  bread-ecosystem runner IS the checkout, no separate clone needed)
- release.yml: copy bakery.toml to DL_DIR during artifact prep

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 22:30:29 +08:00

48 lines
1.2 KiB
YAML

name: release
on:
push:
tags: ["v*"]
env:
DL_DIR: /srv/breadway-dl
jobs:
build:
runs-on: [self-hosted, hestia]
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --release --locked -p bakery
- name: test
run: cargo test --locked --workspace
- name: prepare artifacts
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="${DL_DIR}/bakery/${VERSION}"
mkdir -p "${PKG_DIR}"
cp target/release/bakery "${PKG_DIR}/bakery-x86_64"
strip "${PKG_DIR}/bakery-x86_64"
sha256sum "${PKG_DIR}/bakery-x86_64" | awk '{print $1}' \
> "${PKG_DIR}/bakery-x86_64.sha256"
cp bakery.toml "${PKG_DIR}/bakery.toml"
ln -sfn "${PKG_DIR}" "${DL_DIR}/bakery/latest"
- name: regenerate index.json
run: bash "${GITHUB_WORKSPACE}/scripts/gen-index.sh"
- name: upload to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="${DL_DIR}/bakery/${VERSION}"
gh release upload "${GITHUB_REF_NAME}" \
"${PKG_DIR}/bakery-x86_64" \
"${PKG_DIR}/bakery-x86_64.sha256" \
--clobber