From d2efb9913bb790976c4a0424ba47295e8d475599 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 22:31:01 +0800 Subject: [PATCH] Add bakery.toml and release workflow Wires bread into the bakery ecosystem: prebuilt binaries are published to dl.breadway.dev and GitHub Releases on every v* tag via the self-hosted hestia runner. bakery install bread downloads, verifies, and wires the systemd unit automatically. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 61 +++++++++++++++++++++++++++++++++++ bakery.toml | 18 +++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 bakery.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..615aa10 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: release + +on: + push: + tags: ["v*"] + +env: + DL_DIR: /srv/breadway-dl + ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem + +jobs: + build: + runs-on: [self-hosted, hestia] + steps: + - uses: actions/checkout@v4 + + - name: build + run: cargo build --release --locked + + - name: test + run: cargo test --release --locked --workspace + + - name: prepare artifacts + run: | + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="${DL_DIR}/bread/${VERSION}" + mkdir -p "${PKG_DIR}" + for bin in breadd bread; do + cp "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 packaging/systemd/breadd.service "${PKG_DIR}/" + cp bakery.toml "${PKG_DIR}/bakery.toml" + ln -sfn "${PKG_DIR}" "${DL_DIR}/bread/latest" + + - name: ensure bread-ecosystem + run: | + if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then + git -C "${ECOSYSTEM_DIR}" pull --ff-only + else + mkdir -p "$(dirname "${ECOSYSTEM_DIR}")" + git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}" + fi + + - name: regenerate index.json + run: bash "${ECOSYSTEM_DIR}/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}/bread/${VERSION}" + gh release upload "${GITHUB_REF_NAME}" \ + "${PKG_DIR}/breadd-x86_64" \ + "${PKG_DIR}/bread-x86_64" \ + "${PKG_DIR}/breadd-x86_64.sha256" \ + "${PKG_DIR}/bread-x86_64.sha256" \ + --clobber diff --git a/bakery.toml b/bakery.toml new file mode 100644 index 0000000..52dff3c --- /dev/null +++ b/bakery.toml @@ -0,0 +1,18 @@ +name = "bread" +description = "Reactive automation daemon and CLI for Linux desktops" +binaries = ["breadd", "bread"] +system_deps = [] +bread_deps = [] + +[[service]] +unit = "breadd.service" +enable = true + +[config] +dir = "~/.config/bread" +example = "breadd.toml" + +[install] +post_install = [ + "systemctl --user is-active --quiet breadd || systemctl --user start breadd", +]