Modified - [scripts] [smart-build] [artifacts] Renamed smart-build outputs to include the tag/ref and generated per-file SHA-256 checksums.
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled

- 1 - I updated [`.smart-build.sh`](/config/workspace/gitea-dev/gitea/.smart-build.sh) so each build artifact is now written as `gitea-<tag-or-ref>-<os>-<platform><-sqlite>` with the original executable extension preserved, and each output also gets its own adjacent `.sha256` file generated with `sha256sum` or `shasum -a 256`.

(cherry picked from commit c6f2b32f0b)
(cherry picked from commit bff70ba3de)
This commit is contained in:
2026-05-17 18:15:43 +00:00
parent 725c21ef84
commit 2bf2288ba8
2 changed files with 46 additions and 6 deletions
+3
View File
@@ -783,3 +783,6 @@ History search guidance:
- 1 - I renamed the bootstrap admin actor label and the related immutable-account locale key from `good` to `god` in the admin grant helpers and admin users UI flow.
- 2 - I updated the admin API and admin-panel restriction messages, tests, and both English and Romanian locale strings so bootstrap-protected accounts are consistently labeled as `GOD`-granted.
- 3 - I updated the matching historical task descriptions in `.codex-history.md` so the earlier admin-policy entries now use the corrected `GOD` terminology.
156 - [2026-05-17 18:14:08] - v1.26.0-by-petru-24-gadb90b3453 - Type: Modified - [scripts] [smart-build] [artifacts] Renamed smart-build outputs to include the tag/ref and generated per-file SHA-256 checksums.
- 1 - I updated [`.smart-build.sh`](/config/workspace/gitea-dev/gitea/.smart-build.sh) so each build artifact is now written as `gitea-<tag-or-ref>-<os>-<platform><-sqlite>` with the original executable extension preserved, and each output also gets its own adjacent `.sha256` file generated with `sha256sum` or `shasum -a 256`.
+43 -6
View File
@@ -12,6 +12,37 @@ export NVM_DIR="$HOME/.nvm"
# Forțează folosirea versiunii 22
nvm use 22 > /dev/null 2>&1 || echo "⚠️ NVM nu a putut activa Node 22 automatically."
resolve_build_ref() {
git describe --tags --exact-match 2>/dev/null || git describe --tags --always
}
write_sha256_file() {
local artifact_path="$1"
local artifact_dir artifact_name
artifact_dir="$(dirname "$artifact_path")"
artifact_name="$(basename "$artifact_path")"
if command -v sha256sum > /dev/null 2>&1; then
(
cd "$artifact_dir" || exit 1
sha256sum "$artifact_name" > "$artifact_name.sha256"
)
return
fi
if command -v shasum > /dev/null 2>&1; then
(
cd "$artifact_dir" || exit 1
shasum -a 256 "$artifact_name" > "$artifact_name.sha256"
)
return
fi
echo "❌ Neither sha256sum nor shasum is available for checksum generation."
exit 1
}
# --- 1. VERIFICARE INTEGRITATE ȘI CURĂȚARE CACHE INIȚIALĂ ---
echo "🔍 Initialization checks..."
@@ -192,6 +223,10 @@ if [ -z "$BUILD_VARIANT" ]; then
BUILD_VARIANT="default"
fi
BUILD_REF="$(resolve_build_ref)"
BUILD_REF="${BUILD_REF//\//-}"
echo "🏷️ Build tag/reference: $BUILD_REF"
bindata_needs_update() {
local source_dir="$1"
local bindata_file="$2"
@@ -238,14 +273,14 @@ ensure_bindata_assets
mkdir -p dist
for TARGET in "${TARGETS[@]}"; do
IFS="/" read -r OS ARCH ARM_VER <<< "$TARGET"
EXT="" && [ "$OS" == "windows" ] && EXT=".exe"
SUFFIX="-$OS-$ARCH" && [ ! -z "$ARM_VER" ] && SUFFIX="-$OS-armv$ARM_VER"
PLATFORM="$ARCH" && [ ! -z "$ARM_VER" ] && PLATFORM="armv$ARM_VER"
VARIANT_SUFFIX="" && [ "$BUILD_VARIANT" == "sqlite" ] && VARIANT_SUFFIX="-sqlite"
OUTPUT="dist/gitea$SUFFIX$VARIANT_SUFFIX$EXT"
OUTPUT="dist/gitea-$BUILD_REF-$OS-$PLATFORM$VARIANT_SUFFIX$EXT"
echo "📦 Building for $OS/$ARCH ${ARM_VER:+(v$ARM_VER) }with TAGS=\"$BUILD_TAGS\"..."
export GOOS=$OS
export GOARCH=$ARCH
export GOARM=$ARM_VER
@@ -253,15 +288,17 @@ for TARGET in "${TARGETS[@]}"; do
if [ "$BUILD_VARIANT" == "sqlite" ]; then
export CGO_ENABLED=1
fi
if make build TAGS="$BUILD_TAGS"; then
mv "gitea$EXT" "$OUTPUT"
write_sha256_file "$OUTPUT"
echo "✅ Created: $OUTPUT"
echo "✅ Created: $OUTPUT.sha256"
else
echo "❌ Fail to build for $TARGET"
exit 1
fi
unset GOOS GOARCH GOARM
done