Release build script reads from anvil version
Some checks failed
CI / Test (Linux) (push) Has been cancelled
CI / Test (Windows MSVC) (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Format (push) Has been cancelled

This commit is contained in:
Eric Ratliff
2026-02-22 09:57:37 -06:00
parent 69d537bf8f
commit 6a372e2982
2 changed files with 35 additions and 10 deletions

View File

@@ -2,14 +2,36 @@
# Build release binaries for distribution
# This script builds both Linux and Windows binaries (cross-compile)
#
# Usage:
# ./build-release.sh # version from Cargo.toml (e.g. 1.0.0)
# ./build-release.sh beta1 # appends suffix (e.g. 1.0.0-beta1)
# ./build-release.sh rc1 # appends suffix (e.g. 1.0.0-rc1)
#
# For Windows-only builds, use build-release.ps1 on Windows
# For Linux-only builds, comment out the Windows section below
set -e
VERSION=${1:-$(git describe --tags --always)}
# Read version from the single source of truth: Cargo.toml
BASE_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
if [ -z "$BASE_VERSION" ]; then
echo "Error: Could not read version from Cargo.toml"
exit 1
fi
# Optional suffix (beta1, rc1, etc.)
if [ -n "$1" ]; then
VERSION="${BASE_VERSION}-${1}"
else
VERSION="$BASE_VERSION"
fi
RELEASE_DIR="release-artifacts"
echo "Building Anvil $VERSION release binaries..."
echo "Building Anvil v${VERSION} release binaries..."
echo " Version base: ${BASE_VERSION} (from Cargo.toml)"
if [ -n "$1" ]; then
echo " Suffix: ${1}"
fi
echo ""
# Clean previous artifacts
@@ -63,7 +85,7 @@ cd ..
# Display results
echo ""
echo "==========================================================="
echo " Release artifacts built successfully!"
echo " Anvil v${VERSION} release artifacts built successfully!"
echo "==========================================================="
echo ""
echo "Artifacts in $RELEASE_DIR/:"
@@ -73,7 +95,7 @@ echo "Checksums:"
cat "$RELEASE_DIR/SHA256SUMS"
echo ""
echo "Upload these files to your Gitea release:"
echo " 1. Go to: Releases -> $VERSION -> Edit Release"
echo " 1. Create release: Releases -> New Release -> Tag: v${VERSION}"
echo " 2. Drag and drop files from $RELEASE_DIR/"
echo " 3. Save"
echo ""