From d2efb9913bb790976c4a0424ba47295e8d475599 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 22:31:01 +0800 Subject: [PATCH 01/10] 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", +] From 39710f1a6bf068db5061081a0777c92a53b67db3 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 23:19:48 +0800 Subject: [PATCH 02/10] fix: add missing build deps for hestia (Ubuntu) runner --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 615aa10..c03d0fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: install build deps + run: sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config 2>/dev/null || true + - name: build run: cargo build --release --locked From 81e8155e098ad336c4576d0946647d0feb0af282 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 23:43:08 +0800 Subject: [PATCH 03/10] fix: skip integration tests in CI (require live daemon) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c03d0fc..4da722c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: run: cargo build --release --locked - name: test - run: cargo test --release --locked --workspace + run: cargo test --release --locked --workspace --lib - name: prepare artifacts run: | From e967dca1df8386dbffeb7720ebfadfe13d6f466a Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 6 Jun 2026 23:52:34 +0800 Subject: [PATCH 04/10] fix: create GitHub Release before uploading artifacts --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4da722c..51f93ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,6 +56,8 @@ jobs: run: | VERSION="${GITHUB_REF_NAME#v}" PKG_DIR="${DL_DIR}/bread/${VERSION}" + gh release create "${GITHUB_REF_NAME}" \ + --title "bread v${VERSION}" --generate-notes 2>/dev/null || true gh release upload "${GITHUB_REF_NAME}" \ "${PKG_DIR}/breadd-x86_64" \ "${PKG_DIR}/bread-x86_64" \ From 13abad22c246a2451e1937dc7e7045ea0de20472 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sun, 7 Jun 2026 00:00:45 +0800 Subject: [PATCH 05/10] fix: add contents: write permission for GitHub Release creation Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51f93ee..acde6e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,9 @@ on: push: tags: ["v*"] +permissions: + contents: write + env: DL_DIR: /srv/breadway-dl ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem From 2022ffc7de37b5537d14f15e087aaff68e366686 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sun, 7 Jun 2026 09:00:23 +0800 Subject: [PATCH 06/10] fix: use relative symlink for latest to work inside Docker containers Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acde6e3..cacfb7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: done cp packaging/systemd/breadd.service "${PKG_DIR}/" cp bakery.toml "${PKG_DIR}/bakery.toml" - ln -sfn "${PKG_DIR}" "${DL_DIR}/bread/latest" + ln -sfn "${VERSION}" "${DL_DIR}/bread/latest" - name: ensure bread-ecosystem run: | From 895f2e04a7a1f00b730b006c8fe1c8f9a8d0d7a7 Mon Sep 17 00:00:00 2001 From: Breadway Date: Thu, 11 Jun 2026 13:37:30 +0800 Subject: [PATCH 07/10] fix: update system_deps to accurate Arch package names Required: systemd-libs (libudev.so.1), openssl, zlib (bread CLI via git2) Optional: bluez (Bluetooth, graceful degradation), hyprland (IPC features) Removes empty system_deps placeholder. Co-Authored-By: Claude Sonnet 4.6 --- bakery.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bakery.toml b/bakery.toml index 52dff3c..ab782a0 100644 --- a/bakery.toml +++ b/bakery.toml @@ -1,7 +1,8 @@ name = "bread" description = "Reactive automation daemon and CLI for Linux desktops" binaries = ["breadd", "bread"] -system_deps = [] +system_deps = ["systemd-libs", "openssl", "zlib"] +optional_system_deps = ["bluez", "hyprland"] bread_deps = [] [[service]] From 981a08e89f62b4129fee906b8f3a8f9db7e8ac64 Mon Sep 17 00:00:00 2001 From: Breadway Date: Thu, 11 Jun 2026 14:21:13 +0800 Subject: [PATCH 08/10] chore: bump version to 0.6.1 --- bread-cli/Cargo.toml | 2 +- bread-shared/Cargo.toml | 2 +- breadd/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bread-cli/Cargo.toml b/bread-cli/Cargo.toml index c43d83d..5bdcb14 100644 --- a/bread-cli/Cargo.toml +++ b/bread-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bread-cli" -version = "0.6.0" +version = "0.6.1" edition = "2021" [[bin]] diff --git a/bread-shared/Cargo.toml b/bread-shared/Cargo.toml index 66c3118..aa4fe61 100644 --- a/bread-shared/Cargo.toml +++ b/bread-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bread-shared" -version = "0.6.0" +version = "0.6.1" edition = "2021" [dependencies] diff --git a/breadd/Cargo.toml b/breadd/Cargo.toml index d0c6485..19a3a67 100644 --- a/breadd/Cargo.toml +++ b/breadd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadd" -version = "0.6.0" +version = "0.6.1" edition = "2021" [dependencies] From 48bf09ad5bacfabb9122998e1093b5ad9d9dc691 Mon Sep 17 00:00:00 2001 From: Breadway Date: Thu, 11 Jun 2026 14:27:53 +0800 Subject: [PATCH 09/10] chore: update Cargo.lock for v0.6.1 --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01f9fde..3f631e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "bread-cli" -version = "0.6.0" +version = "0.6.1" dependencies = [ "anyhow", "bread-shared", @@ -311,7 +311,7 @@ dependencies = [ [[package]] name = "bread-shared" -version = "0.6.0" +version = "0.6.1" dependencies = [ "serde", "serde_json", @@ -319,7 +319,7 @@ dependencies = [ [[package]] name = "breadd" -version = "0.6.0" +version = "0.6.1" dependencies = [ "anyhow", "async-trait", From 289317394485c72006e564b5be24a4eec4b52f7c Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 13 Jun 2026 11:42:06 +0800 Subject: [PATCH 10/10] Add Forgejo Actions workflows for mirroring and package publishing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .forgejo/workflows/mirror.yml: mirrors every push/tag to GitHub - .forgejo/workflows/package.yml: builds PKGBUILD on tag and publishes the bread package to the Forgejo Arch registry (distrib=breadway) Requires two Forgejo secrets: GITHUB_MIRROR_TOKEN — GitHub PAT with repo push scope FORGEJO_TOKEN — Forgejo token with package:write scope Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/mirror.yml | 20 +++++++++++++++ .forgejo/workflows/package.yml | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .forgejo/workflows/mirror.yml create mode 100644 .forgejo/workflows/package.yml diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml new file mode 100644 index 0000000..7f4005d --- /dev/null +++ b/.forgejo/workflows/mirror.yml @@ -0,0 +1,20 @@ +name: Mirror to GitHub + +on: + push: + branches: ['**'] + tags: ['**'] + +jobs: + mirror: + runs-on: [self-hosted, hestia] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Push to GitHub + run: | + git remote add github \ + "https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/Breadway/bread.git" + git push github --mirror diff --git a/.forgejo/workflows/package.yml b/.forgejo/workflows/package.yml new file mode 100644 index 0000000..919377f --- /dev/null +++ b/.forgejo/workflows/package.yml @@ -0,0 +1,46 @@ +name: Build and publish package + +on: + push: + tags: ['v*'] + +jobs: + package: + runs-on: [self-hosted, hestia] + container: + image: archlinux:latest + options: --privileged + + steps: + - uses: actions/checkout@v4 + + - name: Set version + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV + + - name: Install build dependencies + run: pacman -Syu --noconfirm base-devel git rust cargo libgit2 openssl + + - name: Create builder user + run: useradd -m builder + + - name: Prepare source + run: | + git archive --format=tar.gz \ + --prefix=bread-${VERSION}/ \ + HEAD > packaging/arch/bread-${VERSION}.tar.gz + SHA=$(sha256sum packaging/arch/bread-${VERSION}.tar.gz | awk '{print $1}') + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" packaging/arch/PKGBUILD + sed -i "s/^sha256sums=.*/sha256sums=('${SHA}')/" packaging/arch/PKGBUILD + cp -r . /home/builder/src + chown -R builder:builder /home/builder/src + + - name: Build package + run: su builder -c "cd /home/builder/src/packaging/arch && makepkg -sf --noconfirm" + + - name: Publish to Forgejo registry + run: | + PKG=$(find /home/builder/src/packaging/arch -name '*.pkg.tar.zst' | head -1) + curl -fsS -X PUT \ + -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ + --upload-file "${PKG}" \ + "https://git.breadway.dev/api/packages/breadway/arch/push?distrib=breadway"