Bump version to 1.0.2
- Add scripts/bump-version.sh for semver patch increments - Update AGENTS.md Dev Commands section and add Version Bumping docs - Makefile default VERSION bumped to 1.0.2
This commit is contained in:
@@ -7,12 +7,11 @@ Go monolith (single binary) with embedded React SPA frontend. Targets Linux amd6
|
||||
## Dev Commands
|
||||
|
||||
```bash
|
||||
# Local dev build (macOS)
|
||||
make build-local
|
||||
# Clean build and package (Linux amd64)
|
||||
make clean && VERSION=X.Y.Z make package
|
||||
|
||||
# Production Linux amd64 build
|
||||
make build # → packaging/debian/usr/bin/syncserver
|
||||
make deb # → dist/syncserver_VERSION_amd64.deb
|
||||
# Build only (no package), Linux amd64
|
||||
make build-all
|
||||
|
||||
# Run
|
||||
./syncserver --data-dir ./data --addr :8080 \
|
||||
@@ -22,6 +21,31 @@ make deb # → dist/syncserver_VERSION_amd64.deb
|
||||
go test ./...
|
||||
```
|
||||
|
||||
## Version Bumping
|
||||
|
||||
Before each push that contains user-facing changes, run the version bump script:
|
||||
|
||||
```bash
|
||||
./scripts/bump-version.sh
|
||||
```
|
||||
|
||||
This reads the current version from `cmd/server/main.go`, increments the patch number (semver), and updates both `cmd/server/main.go` and `Makefile`. Then commit and push:
|
||||
|
||||
```bash
|
||||
git add cmd/server/main.go Makefile
|
||||
git commit -m 'Bump version to X.Y.Z'
|
||||
git push
|
||||
```
|
||||
|
||||
The `DEBIAN/control` uses `@@VERSION@@` placeholder and is substituted at `make package` time — no manual edit needed.
|
||||
|
||||
To verify the LXC is running the expected version:
|
||||
|
||||
```bash
|
||||
ssh root@10.5.1.30 '/usr/bin/syncserver --version'
|
||||
ssh root@10.5.1.30 'journalctl -u syncserver -n 3 --no-pager'
|
||||
```
|
||||
|
||||
## Critical Build Order
|
||||
|
||||
1. Frontend must be built FIRST: `cd web && npm run build`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
BINARY=syncserver
|
||||
VERSION?=1.0.1
|
||||
VERSION?=1.0.2
|
||||
GO?=go
|
||||
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||
BUILD_FLAGS=CGO_ENABLED=0
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
||||
"github.com/syncserver/internal/syncengine"
|
||||
)
|
||||
|
||||
var version = "1.0.1"
|
||||
var version = "1.0.2"
|
||||
|
||||
func main() {
|
||||
cfgPath := flag.String("config", "", "Path to config.yaml")
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
MAIN_GO="$PROJECT_DIR/cmd/server/main.go"
|
||||
MAKEFILE="$PROJECT_DIR/Makefile"
|
||||
|
||||
CURRENT=$(grep -oE 'var version = "[0-9]+\.[0-9]+\.[0-9]+"' "$MAIN_GO" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
if [[ -z "$CURRENT" ]]; then
|
||||
echo "ERROR: cannot parse version from $MAIN_GO" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
NEW="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
|
||||
echo "Bumping version: $CURRENT → $NEW"
|
||||
|
||||
sed -i '' "s/var version = \"${CURRENT}\"/var version = \"${NEW}\"/" "$MAIN_GO"
|
||||
sed -i '' "s/VERSION?=${CURRENT}/VERSION?=${NEW}/" "$MAKEFILE"
|
||||
|
||||
echo "Done. Updated to $NEW"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " git add cmd/server/main.go Makefile"
|
||||
echo " git commit -m 'Bump version to ${NEW}'"
|
||||
echo " git push"
|
||||
Reference in New Issue
Block a user