name: release on: push: tags: ['v*'] jobs: build: if: ${{ !contains(github.ref_name, '-rc.') }} 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 && bash ci/build.sh cargo build --release --locked - name: prepare artifacts run: | set -euo pipefail VERSION="${GITHUB_REF_NAME#v}" PKG_DIR="/srv/breadway-dl/breadarr/${VERSION}" mkdir -p "${PKG_DIR}" for bin in breadarrd breadarr-tui; 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/breadarrd.service "${PKG_DIR}/" cp src/bakery.toml "${PKG_DIR}/bakery.toml" ln -sfn "${VERSION}" "/srv/breadway-dl/breadarr/latest" # Signs with the shared bakery ecosystem signing key (same key that # signs index.json). BAKERY_MINISIGN_SEC_KEY_PATH is a *path on this # runner's disk* (hestia has persistent storage), not the key # contents. Dormant (binaries ship unsigned) until that secret is # provisioned for this repo. - name: sign release binaries env: MINISIGN_SEC_KEY: ${{ secrets.BAKERY_MINISIGN_SEC_KEY_PATH }} run: | set -euo pipefail VERSION="${GITHUB_REF_NAME#v}" PKG_DIR="/srv/breadway-dl/breadarr/${VERSION}" if [ -n "${MINISIGN_SEC_KEY:-}" ]; then for bin in breadarrd breadarr-tui; do minisign -W -S -s "${MINISIGN_SEC_KEY}" -m "${PKG_DIR}/${bin}-x86_64" \ -x "${PKG_DIR}/${bin}-x86_64.minisig" /dev/null || true # mktemp: a fixed clone path races when multiple repos' release # workflows run close together on the same self-hosted runner. ECOSYSTEM_CI_DIR="$(mktemp -d /tmp/bread-ecosystem-ci-XXXXXX)" git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "${ECOSYSTEM_CI_DIR}" bash "${ECOSYSTEM_CI_DIR}/scripts/gen-index.sh" rm -rf "${ECOSYSTEM_CI_DIR}" # No GitHub Release upload step — breadarr has no GitHub mirror, # unlike most sibling bread-ecosystem repos. dl.breadway.dev is the # only distribution point for this repo.