breadpaper/.forgejo/workflows/release.yml
Breadway 2d0cdae396
Some checks failed
Mirror to GitHub / mirror (push) Failing after 1s
release / build (push) Failing after 1s
Build and publish package / package (push) Failing after 1m52s
fix(ci): run release job on hestia host to access cargo and dl server
hestia-host maps to host execution on the Forgejo runner, giving access
to /home/breadway/.cargo/bin/cargo and /srv/breadway-dl without Docker.
2026-06-17 14:54:59 +08:00

48 lines
1.4 KiB
YAML

name: release
on:
push:
tags: ["v*"]
env:
DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem
jobs:
build:
runs-on: hestia-host
steps:
- name: checkout
run: |
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" .
- name: build
run: cargo build --release --locked
- name: test
run: 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 bakery.toml "${PKG_DIR}/bakery.toml"
ln -sfn "${VERSION}" "${DL_DIR}/breadpaper/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"