mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-09-02 00:58:22 +00:00
docs: document binary builds
This commit is contained in:
@@ -5,3 +5,5 @@ config.yaml
|
||||
docker-compose.yml
|
||||
notes.md
|
||||
roadmap.md
|
||||
|
||||
binaries/
|
||||
|
||||
@@ -293,6 +293,14 @@ git push origin main --tags
|
||||
```
|
||||
|
||||
7. Publish release notes on GitHub against the new tag
|
||||
8. Build release binaries and attach them to the GitHub release:
|
||||
|
||||
```bash
|
||||
./build-release.sh
|
||||
```
|
||||
|
||||
The script reads the version from the git tag automatically. Upload the
|
||||
resulting files from `binaries/` as release assets on GitHub.
|
||||
|
||||
## Recognition
|
||||
|
||||
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2026 Beacon Contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#
|
||||
# build-release.sh — cross-compile Beacon for all supported platforms.
|
||||
# Output binaries are written to ./binaries/.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PACKAGE="./cmd/beacon"
|
||||
OUTPUT_DIR="binaries"
|
||||
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
targets=(
|
||||
"linux/amd64/"
|
||||
"linux/arm64/"
|
||||
"linux/arm/7"
|
||||
"darwin/amd64/"
|
||||
"darwin/arm64/"
|
||||
"windows/amd64/"
|
||||
)
|
||||
|
||||
echo "Building Beacon $VERSION"
|
||||
|
||||
for target in "${targets[@]}"; do
|
||||
GOOS=$(echo "$target" | cut -d/ -f1)
|
||||
GOARCH=$(echo "$target" | cut -d/ -f2)
|
||||
GOARM=$(echo "$target" | cut -d/ -f3)
|
||||
|
||||
NAME="beacon-${VERSION}-${GOOS}-${GOARCH}"
|
||||
if [[ -n "$GOARM" ]]; then
|
||||
NAME="${NAME}v${GOARM}"
|
||||
fi
|
||||
|
||||
if [[ "$GOOS" == "windows" ]]; then
|
||||
NAME="${NAME}.exe"
|
||||
fi
|
||||
|
||||
printf " %-40s" "${GOOS}/${GOARCH}${GOARM:+v$GOARM}"
|
||||
|
||||
env GOOS="$GOOS" GOARCH="$GOARCH" ${GOARM:+GOARM="$GOARM"} \
|
||||
go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" \
|
||||
-o "${OUTPUT_DIR}/${NAME}" "$PACKAGE"
|
||||
|
||||
echo "→ ${OUTPUT_DIR}/${NAME}"
|
||||
done
|
||||
|
||||
echo "Done."
|
||||
@@ -33,6 +33,10 @@ import (
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
// version is set at build time via -ldflags "-X main.version=vX.Y.Z".
|
||||
// Falls back to "dev" when built without the flag.
|
||||
var version = "dev"
|
||||
|
||||
// @title MeshCore Beacon API
|
||||
// @version 1.4.0
|
||||
// @description MeshCore network observation backend. Ingests LoRa packets from MQTT brokers, stores in PostgreSQL, and streams live events via WebSocket.
|
||||
@@ -67,6 +71,7 @@ import (
|
||||
// @tag.name Stats
|
||||
// @tag.description Network statistics and time series
|
||||
func main() {
|
||||
log.Printf("beacon version %s", version)
|
||||
_ = godotenv.Load()
|
||||
addr := os.Getenv("LISTEN_ADDR")
|
||||
if addr == "" {
|
||||
|
||||
Reference in New Issue
Block a user