mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 09:06:14 +00:00
refactor: Replace ldflags version injection with debug.BuildInfo
- Use debug.ReadBuildInfo() for version information (Go 1.18+ best practice) - Extract version from module info and VCS settings (vcs.revision, vcs.time) - Remove complex ldflags setup from Makefile and GitHub workflows - Simplify build process while maintaining all version information - Cleaner approach recommended by Go community Thanks to Gopher Slack feedback for this improvement!
This commit is contained in:
@@ -154,9 +154,9 @@ jobs:
|
||||
rm -f "$OUTPUT_NAME" "$OUTPUT_NAME.sha256" "$OUTPUT_NAME.sha512"
|
||||
go clean -cache
|
||||
|
||||
# Build with optimizations and version info
|
||||
# Build with optimizations (using debug.BuildInfo for version info)
|
||||
if ! go build \
|
||||
-ldflags="-s -w -X main.version=v${{ needs.validate.outputs.version }} -X main.commit=${{ github.sha }} -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
-ldflags="-s -w" \
|
||||
-o "$OUTPUT_NAME" \
|
||||
./cmd/soundtouch-cli; then
|
||||
echo "❌ Build failed"
|
||||
|
||||
Reference in New Issue
Block a user