Files
comet/release.sh
Ken Johnson 46912a9798
Some checks failed
Build and Release / build-and-release (push) Has been cancelled
Version 1.1-1, standardize naming and move tests
- Adopt standard versioning: 1.0, 1.1, 1.1-1 (major.minor-revision)
- Archive naming: comet-1.1-1-linux-x64.tar.gz (professional format)
- Move test sources from src/ to test/ directory
- Update Makefile, release script, and CI workflow to match
2026-04-07 09:00:39 -07:00

96 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
# Build all platforms, package, and push a release to GitHub/Gitea
# Usage: ./release.sh v1.01.01 "Release notes here"
set -e
TAG="$1"
NOTES="$2"
if [ -z "$TAG" ]; then
echo "Usage: $0 <tag> [release notes]"
echo "Example: $0 v1.01.01 \"Nodelist year-rollover fix\""
exit 1
fi
VER="${TAG#v}"
echo "=== Building Comet $VER ==="
make clean
make all-platforms
echo "=== Running tests ==="
make test
echo "=== Packaging releases ==="
mkdir -p dist
rm -f dist/comet-${VER}-*
# Update COMET.DOC version
sed "s/Version [0-9][0-9]*\.[0-9][0-9]*/Version $VER/g; s/Comet [0-9][0-9]*\.[0-9][0-9]*/Comet $VER/g" COMET.DOC > /tmp/COMET.DOC
DOCS="COMET.SAM COMET.QA FSP-COMET.001 INSTALL.txt"
build_platform() {
local plat="$1" binary="$2" fmt="$3" desc="$4"
local dir="comet-${VER}-${plat}"
mkdir -p "dist/$dir"
cp "$binary" "dist/$dir/"
cp $DOCS "dist/$dir/" 2>/dev/null || true
cp /tmp/COMET.DOC "dist/$dir/"
# Include systemd service for Linux
if [ "$plat" = "linux-x64" ] && [ -f releases/staging/comet-*-linux-x64/comet.service ]; then
cp releases/staging/comet-*-linux-x64/comet.service "dist/$dir/" 2>/dev/null || true
fi
cat > "dist/$dir/FILE_ID.DIZ" <<EOF
Comet $VER - FidoNet TCP Mailer
$desc
Direct TCP file transfer for FidoNet
SHA-256 verification, sliding window,
ED25519/CRAM-MD5 authentication,
per-block zlib compression, BinkP
compatible on port 24554.
Bidirectional transfers with adaptive
block sizing (512B-64KB). Supports
BSO, FrontDoor, D'Bridge outbound.
(C) 2026 Ken Johnson 1:218/720 GPL2
EOF
if [ "$fmt" = "tar" ]; then
tar czf "dist/comet-${VER}-${plat}.tar.gz" -C dist "$dir"
else
(cd dist && zip -r "comet-${VER}-${plat}.zip" "$dir")
fi
rm -rf "dist/$dir"
}
build_platform linux-x64 build/linux/comet tar "Linux x86-64 binary."
build_platform freebsd-x64 build/freebsd/comet tar "FreeBSD x86-64 binary."
build_platform win64 build/win/comet.exe zip "Windows x86-64 binary."
build_platform dos build/go32v2/comet.exe zip "DOS (DJGPP/Watt-32) binary."
build_platform os2 build/os2/comet.exe zip "OS/2 binary."
echo ""
echo "=== Archives ==="
ls -lh dist/comet-${VER}-*
echo ""
echo "=== Pushing release $TAG ==="
git tag "$TAG" 2>/dev/null || echo "Tag $TAG already exists"
git push origin "$TAG" 2>/dev/null || echo "Tag already pushed (or no remote)"
gh release create "$TAG" \
dist/comet-${VER}-linux-x64.tar.gz \
dist/comet-${VER}-freebsd-x64.tar.gz \
dist/comet-${VER}-win64.zip \
dist/comet-${VER}-dos.zip \
dist/comet-${VER}-os2.zip \
--title "Comet $VER" \
--notes "${NOTES:-Release $VER}"
echo ""
echo "=== Done ==="