Files
coursebank/scripts/dist-attach.sh
T
alexm 3a7a0d5873
Pipeline / check (push) Successful in 1m56s
Pipeline / release (push) Skipped
Pipeline / docs (push) Successful in 1m47s
Pipeline / nightly (push) Successful in 6m41s
feat: provide way to build and attach platforms
2026-08-08 11:46:15 -04:00

28 lines
908 B
Bash
Executable File

#!/usr/bin/env bash
# Build the host-native release bundle and attach it to an existing Gitea
# release. Meant for targets CI cannot build. Check out
# the tagged commit first, so the crate version matches the tag.
#
# Required env: GITEA_API, GITEA_TOKEN (contents:write).
# Optional env: TAG (defaults to the crate version), JQ.
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
: "${GITEA_API:?set GITEA_API, e.g., https://git.scient.ing/api/v1/repos/<owner>/<repo>}"
: "${GITEA_TOKEN:?set GITEA_TOKEN to a token with contents:write}"
version="$(bash "$here/version.sh")"
tag="${TAG:-$version}"
asset="coursebank-${version}-$(bash "$here/platform-tag.sh").tar.gz"
echo "building ${asset} for release ${tag}"
pixi run setup-tools
pixi run dist
bash "$here/package.sh" "$asset" dist
TAG="$tag" ASSETS="$asset $asset.sha256" bash "$here/attach-asset.sh"
echo "done: ${asset} attached to ${tag}"