6b35d863c9
ScoutFS-Build-style pipeline that pulls upstream versitygw release tags, applies the web-UI de-brand patch series, and builds GoReleaser releases (binaries + deb/rpm) for publishing to Gitea. Artifact names stay versitygw; only the embedded admin UI is rebranded to S3 Gateway. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
43 lines
1.5 KiB
Bash
43 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# Build de-branded versitygw release artifacts from the patched source
|
|
# tree using upstream's GoReleaser config. Artifacts land in
|
|
# <src>/dist/. Run ci/clone-source.sh and ci/apply-patches.sh first.
|
|
#
|
|
# We keep upstream's artifact names: the binary stays `versitygw` and
|
|
# the deb/rpm packages stay `versitygw` — only the embedded web UI is
|
|
# de-branded. So upstream's .goreleaser.yaml is used unmodified.
|
|
#
|
|
# Environment:
|
|
# VGW_SRC_DIR patched source tree (default: src)
|
|
# VGW_TAG upstream tag -> release version (required)
|
|
# GORELEASER goreleaser binary (default: goreleaser)
|
|
set -euo pipefail
|
|
|
|
VGW_SRC_DIR="${VGW_SRC_DIR:-src}"
|
|
: "${VGW_TAG:?VGW_TAG must be set}"
|
|
GORELEASER="${GORELEASER:-goreleaser}"
|
|
|
|
SRC="$(cd "${VGW_SRC_DIR}" && pwd)"
|
|
cd "${SRC}"
|
|
|
|
if ! command -v "${GORELEASER}" >/dev/null 2>&1; then
|
|
echo "ERROR: '${GORELEASER}' not found in PATH." >&2
|
|
echo " Install from https://goreleaser.com or set \$GORELEASER." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# The tree carries downstream patch commits on top of the tag, so HEAD
|
|
# is no longer exactly the tag. Pin the version GoReleaser stamps and
|
|
# skip the clean-tree / tag validations.
|
|
export GORELEASER_CURRENT_TAG="${VGW_TAG}"
|
|
|
|
echo ">>> building ${VGW_TAG} with $("${GORELEASER}" --version | head -1)..."
|
|
"${GORELEASER}" release --clean --skip=validate,publish
|
|
|
|
echo ">>> artifacts in ${SRC}/dist:"
|
|
ls -1 dist/*.tar.gz dist/*.zip dist/*.deb dist/*.rpm dist/checksums.txt 2>/dev/null || ls -1 dist/
|
|
|
|
if [[ -n "${GITHUB_ENV:-}" ]]; then
|
|
echo "VGW_DIST_DIR=${SRC}/dist" >> "${GITHUB_ENV}"
|
|
fi
|