breadpaper/.forgejo/workflows/release.yml
Breadway 3eff1e5972
All checks were successful
check / check (push) Successful in 4s
ci: build inside bread-ecosystem's shared Arch container
Ports breadpaper onto bread-ecosystem's shared, pinned Arch build
image/script instead of installing toolchain/libraries directly on the
bare self-hosted runner. Follows the pattern proven in breadpad:
ci/build.sh clones bread-ecosystem pinned to the sha in
ci/bread-ecosystem.rev and delegates to its ci/build.sh.

breadpaper needs nothing beyond the shared image's base package set
(only clap/anyhow as deps, no image-processing or GTK crates), so no
ci/deps.txt is added.

Also adds check.yml: clippy + test on feature/**/fix/** pushes, as a
fast pre-release-build signal, matching breadpaper's own build/test
flags (--release --locked, no --workspace since this isn't a
workspace).
2026-08-05 19:14:49 +08:00

55 lines
1.7 KiB
YAML

name: release
on:
push:
tags: ["v*"]
env:
DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
PATH: /home/breadway/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
jobs:
build:
if: ${{ !contains(github.ref_name, '-rc.') }}
runs-on: hestia
defaults:
run:
working-directory: /tmp/breadpaper-build
steps:
- name: checkout
working-directory: /tmp
run: |
rm -rf /tmp/breadpaper-build
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" /tmp/breadpaper-build
- name: build
run: bash ci/build.sh cargo build --release --locked
- name: test
run: bash ci/build.sh cargo test --release --locked
- name: prepare artifacts
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="${DL_DIR}/breadpaper/${VERSION}"
mkdir -p "${PKG_DIR}"
cp target/release/breadpaper "${PKG_DIR}/breadpaper-x86_64"
strip "${PKG_DIR}/breadpaper-x86_64"
sha256sum "${PKG_DIR}/breadpaper-x86_64" | awk '{print $1}' \
> "${PKG_DIR}/breadpaper-x86_64.sha256"
cp LICENSE "${PKG_DIR}/"
cp bakery.toml "${PKG_DIR}/bakery.toml"
ln -sfn "${VERSION}" "${DL_DIR}/breadpaper/latest"
- name: ensure bread-ecosystem
working-directory: /tmp
run: |
rm -rf "${ECOSYSTEM_DIR}"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
- name: regenerate index.json
working-directory: /tmp
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"