feat: initial Go project scaffold with build/test/release pipeline
- Go module: github.com/netcell-it/deklarix - cmd/server/main.go: HTTP entry point with /health endpoint - scripts/build.sh: cross-compile amd64 + arm64 - scripts/test.sh: go vet + race tests + build-check - scripts/release.sh: full release flow (test → build → tag → push) - packaging/DEBIAN: .deb control template - design/enterprise.css: enterprise design system from enconf - CLAUDE.md: complete build/test/release documentation - .claude/settings.local.json: Claude Code permissions
This commit is contained in:
60
scripts/release.sh
Executable file
60
scripts/release.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
# Deklarix — Release-Skript
|
||||
#
|
||||
# Verwendung: ./scripts/release.sh <version>
|
||||
# Beispiel: ./scripts/release.sh 1.2.0
|
||||
#
|
||||
# Was passiert:
|
||||
# 1. Tests laufen
|
||||
# 2. Build für amd64 + arm64
|
||||
# 3. git tag v<version> wird gesetzt
|
||||
# 4. git push origin main + git push origin v<version>
|
||||
#
|
||||
# Voraussetzungen:
|
||||
# - Sauberer Git-Status (keine uncommitted changes)
|
||||
# - Alle Tests grün
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
VERSION="${1:-}"
|
||||
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
echo "Verwendung: $0 <version> (z.B. 1.0.0)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GRN='\033[0;32m'; BLD='\033[1m'; NC='\033[0m'
|
||||
log() { echo -e "${GRN}[release]${NC} $*"; }
|
||||
|
||||
cd "$REPO_DIR"
|
||||
|
||||
# Git-Status prüfen
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
echo "FEHLER: Uncommitted changes vorhanden — bitte erst committen"
|
||||
git status --short
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Release v${VERSION} wird vorbereitet..."
|
||||
|
||||
# Tests
|
||||
log "Tests laufen..."
|
||||
bash "$REPO_DIR/scripts/test.sh"
|
||||
|
||||
# Build
|
||||
log "Build für alle Architekturen..."
|
||||
bash "$REPO_DIR/scripts/build.sh" "$VERSION"
|
||||
|
||||
# Git Tag
|
||||
log "Tag v${VERSION} setzen..."
|
||||
git tag -a "v${VERSION}" -m "Release v${VERSION}"
|
||||
|
||||
# Push
|
||||
log "Push main + Tag..."
|
||||
git push origin main
|
||||
git push origin "v${VERSION}"
|
||||
|
||||
log ""
|
||||
log "Release v${VERSION} fertig ✓"
|
||||
log "Binaries: dist/deklarix_${VERSION}_amd64 + _arm64"
|
||||
Reference in New Issue
Block a user