From 6b5f4f475f66a645b08cb865e6dda8228d23679b Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 22:30:04 +0800 Subject: [PATCH] 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//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 --- .github/workflows/release.yml | 10 ++++++---- bakery.toml | 8 ++++++++ scripts/gen-index.sh | 10 +++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 bakery.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72172ba..7b2c401 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: env: DL_DIR: /srv/breadway-dl - ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem jobs: build: @@ -15,7 +14,10 @@ jobs: - uses: actions/checkout@v4 - name: build - run: cargo build --release --locked + run: cargo build --release --locked -p bakery + + - name: test + run: cargo test --locked --workspace - name: prepare artifacts run: | @@ -28,11 +30,11 @@ jobs: sha256sum "${PKG_DIR}/bakery-x86_64" | awk '{print $1}' \ > "${PKG_DIR}/bakery-x86_64.sha256" - # Update the 'latest' symlink. + cp bakery.toml "${PKG_DIR}/bakery.toml" ln -sfn "${PKG_DIR}" "${DL_DIR}/bakery/latest" - name: regenerate index.json - run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" + run: bash "${GITHUB_WORKSPACE}/scripts/gen-index.sh" - name: upload to GitHub Release env: diff --git a/bakery.toml b/bakery.toml new file mode 100644 index 0000000..057558d --- /dev/null +++ b/bakery.toml @@ -0,0 +1,8 @@ +name = "bakery" +description = "Bread ecosystem package manager" +binaries = ["bakery"] +system_deps = [] +bread_deps = [] + +[install] +post_install = [] diff --git a/scripts/gen-index.sh b/scripts/gen-index.sh index ead3d94..d6630d3 100644 --- a/scripts/gen-index.sh +++ b/scripts/gen-index.sh @@ -16,6 +16,7 @@ OUT="${DL_DIR}/index.json" # Products are read from the registry. Each line is "name repo". products=( + "bakery Breadway/bread-ecosystem" "bread Breadway/bread" "breadbar Breadway/breadbar" "breadbox Breadway/breadbox" @@ -72,9 +73,12 @@ build_package_json() { binaries_json="$(jq -n --argjson arr "${binaries_json}" --argjson e "${entry}" '$arr + [$e]')" done - # Read bakery.toml for this product from a co-located checkout if available, - # else use minimal defaults. - local bakery_toml="${SCRIPT_DIR}/../${name}/bakery.toml" + # Read bakery.toml: the release workflow copies it to DL_DIR alongside the + # binaries; fall back to a sibling checkout for local dev use. + local bakery_toml="${DL_DIR}/${name}/bakery.toml" + if [[ ! -f "${bakery_toml}" ]]; then + bakery_toml="${SCRIPT_DIR}/../${name}/bakery.toml" + fi local description="" local system_deps="[]" local bread_deps="[]"