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.
This commit is contained in:
parent
e57f085e37
commit
76e503b837
2 changed files with 79 additions and 0 deletions
61
.github/workflows/release.yml
vendored
Normal file
61
.github/workflows/release.yml
vendored
Normal file
|
|
@ -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
|
||||||
18
bakery.toml
Normal file
18
bakery.toml
Normal file
|
|
@ -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",
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue