diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 5cee7d9..f2a8566 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -14,8 +14,6 @@ jobs: set -euo pipefail git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git - # Mirror only branches and tags (not refs/pull/*, which GitHub rejects); - # --prune deletes GitHub refs that no longer exist on Forgejo. git push --prune \ "https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/bread.git" \ '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*' diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..fd4669c --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,61 @@ +name: release + +on: + push: + tags: ["v*"] + +jobs: + build: + 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: test + run: cd src && cargo test --release --locked --workspace + + - name: prepare artifacts + run: | + set -euo pipefail + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="/srv/breadway-dl/bread/${VERSION}" + mkdir -p "${PKG_DIR}" + for bin in breadd bread; 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/breadd.service "${PKG_DIR}/" + cp src/bakery.toml "${PKG_DIR}/bakery.toml" + ln -sfn "${VERSION}" "/srv/breadway-dl/bread/latest" + + - name: regenerate index.json + run: | + set -euo pipefail + rm -rf /tmp/bread-ecosystem-ci + git clone https://git.breadway.dev/Breadway/bread-ecosystem.git /tmp/bread-ecosystem-ci + bash /tmp/bread-ecosystem-ci/scripts/gen-index.sh + + - name: upload to GitHub Release + env: + GH_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }} + run: | + set -euo pipefail + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="/srv/breadway-dl/bread/${VERSION}" + gh release create "${GITHUB_REF_NAME}" --repo Breadway/bread \ + --title "bread v${VERSION}" --generate-notes 2>/dev/null || true + gh release upload "${GITHUB_REF_NAME}" --repo Breadway/bread \ + "${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/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 217ff7e..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: release - -on: - push: - tags: ["v*"] - -permissions: - contents: write - -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: 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 - - - 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 "${VERSION}" "${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 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" \ - "${PKG_DIR}/breadd-x86_64.sha256" \ - "${PKG_DIR}/bread-x86_64.sha256" \ - --clobber diff --git a/README.md b/README.md index 0fab7e2..e3fbf08 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ All commands communicate with the running daemon over a Unix socket at `$XDG_RUN bread ping # Check daemon connectivity bread health # Daemon version, uptime, PID bread doctor # Diagnose daemon and module health +bread doctor --json # Output raw JSON # Lua runtime bread reload # Hot-reload all Lua modules @@ -182,9 +183,13 @@ bread reload --watch # Watch config dir and reload on changes # State and events bread state # Dump full runtime state as JSON +bread state network # Read a single path from state +bread state --json # Output raw JSON bread events # Stream live normalized events bread events bread.device.* # Stream filtered events bread events --since 60 # Replay events from the last 60 seconds +bread events --fields event,data # Limit output to specific fields +bread events --json # Output raw JSON bread emit # Manually fire an event (for testing) # Profiles @@ -194,7 +199,7 @@ bread profile-activate # Activate a named profile # Modules bread modules list # List installed modules and daemon status bread modules install /local/path # Install from a local module directory -bread modules remove # Remove an installed module +bread modules remove # Remove an installed module (--yes skips confirmation) bread modules info # Show full manifest and daemon status ``` @@ -377,8 +382,9 @@ bread.profile.activate("default") bread.exec("kitty") -- Desktop notification (uses notify-send) -bread.notify("Title", { urgency = "normal", timeout = 3000, icon = "dialog-info" }) -bread.notify("Simple message") -- title defaults to "bread" +-- First arg is the message body; opts.title sets the notification title (default: "bread") +bread.notify("Something happened", { title = "My Module", urgency = "normal", timeout = 3000, icon = "dialog-info" }) +bread.notify("AC connected") -- title defaults to "bread" ``` ### Timers