Merge Bose-SoundTouch-API (soundcork-go) into Bose-SoundTouch. Integrated service logic, created soundtouch-service command, embedded resources, updated docs, examples and CI/CD.

Commit history from `7204e619decc48df5dee91d18470934b50e389ac` to `f9b5ad3129831086b02bdf20a197ff4e2d098e2d`: https://github.com/gesellix/Bose-SoundTouch-API/compare/7204e619decc48df5dee91d18470934b50e389ac...f9b5ad3129831086b02bdf20a197ff4e2d098e2d

* f9b5ad3 - Tobias Gesellchen, 2026-02-07 : Rename module to gesellix/bose-soundtouch-api and update related files
* 5b3dbbb - Tobias Gesellchen, 2026-02-07 : docs: translate PLAN.md to English and fix preferredLanguage typo in marge.go
* 696b9c9 - Tobias Gesellchen, 2026-02-07 : feat(discovery): fetch serial number from speaker info if missing in discovery and update datastore tests
* 8ed78f0 - Tobias Gesellchen, 2026-02-07 : Consolidate proxy and main service on port 8000 and update related tests and UI
* 0e3abbb - Tobias Gesellchen, 2026-02-07 : feat(go): lowercase guessed hostnames for URL consistency
* ca1091f - Tobias Gesellchen, 2026-02-07 : feat(health): add health endpoint with VCS build information
* a432d53 - Tobias Gesellchen, 2026-02-07 : Rename mock token to soundcork-local-token and add documentation
* 3b5ee2f - Tobias Gesellchen, 2026-02-07 : Implement Phase 10: Stats API, Device Event Log, and advanced Marge functions
* bc96033 - Tobias Gesellchen, 2026-02-06 : chore
* c77864b - Tobias Gesellchen, 2026-02-06 : Document Golang header normalization behavior and ensure generic header casing preservation in proxy
* a54e7e7 - Tobias Gesellchen, 2026-02-06 : Ensure ETag header preserves casing (uppercase 'T') for case-sensitive devices
* 6265fbe - Tobias Gesellchen, 2026-02-06 : update dockerfile to be in sync with go.mod
* 5290bad - Tobias Gesellchen, 2026-02-06 : Implement proxy logging settings UI and complete Phase 8 quick wins (ETags, DataStore initialization)
* d7aa7f7 - Tobias Gesellchen, 2026-02-06 : Update PLAN.md with recent features and Phase 8 Upstream Parity tasks
* c8ae5e2 - Tobias Gesellchen, 2026-02-06 : Enhance Bose SoundTouch migration with proxying, remote services persistence, and improved diagnostics
* c53fa00 - Tobias Gesellchen, 2026-02-06 : Implement remote services persistence check and UI improvements for Bose SoundTouch migration
* ea5c348 - Tobias Gesellchen, 2026-02-02 : Ignore soundcork-go/data directory and include recent datastore fixes
* d162892 - Tobias Gesellchen, 2026-02-02 : Complete Phase 7: Automated Setup & UI refactoring. Implemented programmatic SSH/migration logic, added device discovery endpoints, created Web UI for speaker management, and refactored UI to use external HTML with Go embed.
* b528016 - Tobias Gesellchen, 2026-02-01 : Add GitHub workflow to publish Docker image to GHCR and update Dockerfile
* 2ee03da - Tobias Gesellchen, 2026-02-01 : Add GitHub Actions workflow for Go CI and update PLAN.md
* 439e2a9 - Tobias Gesellchen, 2026-02-01 : Refactor Go implementation: extract handlers and tests into dedicated files, add comprehensive unit and HTTP tests
* c0698fb - Tobias Gesellchen, 2026-02-01 : Add Docker telnet example and update IP consistency in documentation
* 028a02e - Tobias Gesellchen, 2026-02-01 : Fix older port number in README
* 264829d - Tobias Gesellchen, 2026-02-01 : Add setup-speaker.sh and update documentation to match issue #59
* 64306f9 - Tobias Gesellchen, 2026-02-01 : Implement device presets endpoint in Go
* b98a602 - Tobias Gesellchen, 2026-02-01 : Implement Phase 4: Datastore and Marge logic in Go
* b6e1bc9 - Tobias Gesellchen, 2026-02-01 : Implement Phase 3: BMX Streaming and Service Registry in Go
* f1b3dcf - Tobias Gesellchen, 2026-02-01 : Port core models and constants to Go
* 9eae655 - Tobias Gesellchen, 2026-02-01 : Implement static file serving for /media in Go
* cc73e50 - Tobias Gesellchen, 2026-02-01 : Fix Go service accessibility and improve Docker configuration
* e356bdd - Tobias Gesellchen, 2026-02-01 : Initialize Go migration: Phase 1 infrastructure, proxy-first routing, and root endpoint
This commit is contained in:
Tobias Gesellchen
2026-02-07 22:36:50 +01:00
parent 5b9ab48897
commit 79ca666785
62 changed files with 6769 additions and 78 deletions
+68 -76
View File
@@ -113,100 +113,87 @@ jobs:
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}-${{ hashFiles('**/go.sum') }}
- name: Build binary
- name: Build binaries
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: 0
run: |
# Determine output filename
BINARY_NAME="soundtouch-cli"
# Common variables
ARCH_SUFFIX="${{ matrix.goos }}-${{ matrix.goarch }}"
if [[ "${{ matrix.goarm }}" != "" ]]; then
ARCH_SUFFIX="${ARCH_SUFFIX}v${{ matrix.goarm }}"
fi
if [[ "${{ matrix.goos }}" == "windows" ]]; then
OUTPUT_NAME="${BINARY_NAME}-v${{ needs.validate.outputs.version }}-${ARCH_SUFFIX}.exe"
else
OUTPUT_NAME="${BINARY_NAME}-v${{ needs.validate.outputs.version }}-${ARCH_SUFFIX}"
fi
# Function to build a binary
build_binary() {
local BINARY_NAME=$1
local CMD_PATH=$2
local OUTPUT_NAME
echo "Building: $OUTPUT_NAME"
if [[ "${{ matrix.goos }}" == "windows" ]]; then
OUTPUT_NAME="${BINARY_NAME}-v${{ needs.validate.outputs.version }}-${ARCH_SUFFIX}.exe"
else
OUTPUT_NAME="${BINARY_NAME}-v${{ needs.validate.outputs.version }}-${ARCH_SUFFIX}"
fi
# Debug: Show current state
echo "Working directory: $(pwd)"
echo "Go version: $(go version)"
echo "Files before build:"
ls -la
echo "Building $BINARY_NAME: $OUTPUT_NAME"
# Debug: Show Go cache and module cache
echo "Go build cache location: $(go env GOCACHE)"
echo "Go module cache location: $(go env GOMODCACHE)"
echo "Go build cache contents:"
ls -la "$(go env GOCACHE)" 2>/dev/null || echo "Cache directory not accessible"
echo "Go module cache contents (top level):"
ls -la "$(go env GOMODCACHE)" 2>/dev/null || echo "Module cache directory not accessible"
# Ensure clean build environment for this binary
rm -f "$OUTPUT_NAME" "$OUTPUT_NAME.sha256" "$OUTPUT_NAME.sha512"
# Ensure clean build environment
rm -f "$OUTPUT_NAME" "$OUTPUT_NAME.sha256" "$OUTPUT_NAME.sha512"
go clean -cache
if ! go build \
-ldflags="-s -w" \
-o "$OUTPUT_NAME" \
"$CMD_PATH"; then
echo "❌ Build failed for $BINARY_NAME"
exit 1
fi
# Build with optimizations (using debug.BuildInfo for version info)
if ! go build \
-ldflags="-s -w" \
-o "$OUTPUT_NAME" \
./cmd/soundtouch-cli; then
echo "❌ Build failed"
echo "Files after failed build:"
ls -la
exit 1
fi
# Verify binary was created
ls -la "$OUTPUT_NAME"
echo "$BINARY_NAME=$OUTPUT_NAME" >> $GITHUB_OUTPUT
}
# Debug: Show post-build state
echo "Files after successful build:"
ls -la
# Verify binary was created and is executable
ls -la "$OUTPUT_NAME"
file "$OUTPUT_NAME"
echo "binary_name=$OUTPUT_NAME" >> $GITHUB_OUTPUT
# Build CLI
build_binary "soundtouch-cli" "./cmd/soundtouch-cli"
# Build Service
build_binary "soundtouch-service" "./cmd/soundtouch-service"
id: build
- name: Generate individual checksum
- name: Generate individual checksums
run: |
OUTPUT_NAME="${{ steps.build.outputs.binary_name }}"
CLI_NAME="${{ steps.build.outputs.soundtouch-cli }}"
SVC_NAME="${{ steps.build.outputs.soundtouch-service }}"
# Use atomic operations to avoid conflicts
TEMP_DIR=$(mktemp -d)
echo "Building checksums for: $OUTPUT_NAME"
echo "Matrix: ${{ matrix.goos }}-${{ matrix.goarch }}"
generate_checksums() {
local FILE=$1
echo "Building checksums for: $FILE"
sha256sum "$FILE" > "${TEMP_DIR}/$(basename "$FILE").sha256"
sha512sum "$FILE" > "${TEMP_DIR}/$(basename "$FILE").sha512"
mv "${TEMP_DIR}/$(basename "$FILE").sha256" "$FILE.sha256"
mv "${TEMP_DIR}/$(basename "$FILE").sha512" "$FILE.sha512"
}
# Generate checksums in temp directory first
sha256sum "$OUTPUT_NAME" > "${TEMP_DIR}/$(basename "$OUTPUT_NAME").sha256"
sha512sum "$OUTPUT_NAME" > "${TEMP_DIR}/$(basename "$OUTPUT_NAME").sha512"
# Move to final location atomically
mv "${TEMP_DIR}/$(basename "$OUTPUT_NAME").sha256" "$OUTPUT_NAME.sha256"
mv "${TEMP_DIR}/$(basename "$OUTPUT_NAME").sha512" "$OUTPUT_NAME.sha512"
generate_checksums "$CLI_NAME"
generate_checksums "$SVC_NAME"
# Cleanup
rm -rf "$TEMP_DIR"
echo "✅ Checksums generated successfully"
- name: Upload build artifact
uses: actions/upload-artifact@v6
with:
name: ${{ steps.build.outputs.binary_name }}
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm }}
path: |
${{ steps.build.outputs.binary_name }}
${{ steps.build.outputs.binary_name }}.sha256
${{ steps.build.outputs.binary_name }}.sha512
soundtouch-cli-v*
soundtouch-service-v*
retention-days: 1
checksums:
@@ -226,13 +213,13 @@ jobs:
# Debug: Show the downloaded structure
echo "📁 Downloaded artifact structure:"
find . -type f -name "soundtouch-cli-*"
ls -R
# Create a collection directory to avoid naming conflicts
mkdir -p release-files
# Move all files from subdirectories to the collection directory
find . -mindepth 2 -type f -name "soundtouch-cli-*" -exec mv {} release-files/ \;
find . -mindepth 2 -type f \( -name "soundtouch-cli-*" -o -name "soundtouch-service-*" \) -exec mv {} release-files/ \;
# Remove empty directories
find . -type d -empty -delete
@@ -242,20 +229,20 @@ jobs:
# Debug: Show flattened structure
echo "📁 Flattened structure:"
ls -la soundtouch-cli-* || echo "No files found matching pattern"
ls -la soundtouch-* || echo "No files found matching pattern"
# Generate combined checksums (exclude individual .sha256/.sha512 files)
if ls soundtouch-cli-v* 1> /dev/null 2>&1; then
if ls soundtouch-* 1> /dev/null 2>&1; then
# Only checksum the actual binaries, not the .sha256/.sha512 files
ls soundtouch-cli-v* | grep -v '\.sha256$' | grep -v '\.sha512$' | xargs sha256sum > checksums.sha256
ls soundtouch-cli-v* | grep -v '\.sha256$' | grep -v '\.sha512$' | xargs sha512sum > checksums.sha512
ls soundtouch-* | grep -v '\.sha256$' | grep -v '\.sha512$' | xargs sha256sum > checksums.sha256
ls soundtouch-* | grep -v '\.sha256$' | grep -v '\.sha512$' | xargs sha512sum > checksums.sha512
echo "📋 Generated combined checksums:"
cat checksums.sha256
# Verify all expected files are present (binaries only, not checksum files)
EXPECTED_COUNT=7 # Based on build matrix
ACTUAL_COUNT=$(ls soundtouch-cli-v* | grep -v '\.sha256$' | grep -v '\.sha512$' | wc -l)
EXPECTED_COUNT=14 # 7 platforms * 2 binaries
ACTUAL_COUNT=$(ls soundtouch-* | grep -v '\.sha256$' | grep -v '\.sha512$' | wc -l)
if [[ $ACTUAL_COUNT -ne $EXPECTED_COUNT ]]; then
echo "❌ Expected $EXPECTED_COUNT binaries, found $ACTUAL_COUNT"
@@ -369,19 +356,20 @@ jobs:
- [Troubleshooting Guide](docs/TROUBLESHOOTING.md) - Systematic issue resolution
- [Deployment Guide](docs/DEPLOYMENT.md) - Production deployment examples (Docker, K8s, systemd)
## 🔧 CLI Tool
## 🔧 CLI & Service Tools
Download the CLI tool for your platform from the assets below:
Download the tools for your platform from the assets below:
### CLI Tool
\`\`\`bash
# Quick device discovery
./soundtouch-cli -discover
\`\`\`
# Get device information
./soundtouch-cli -host 192.168.1.100 -info
# Monitor real-time events
./soundtouch-cli -host 192.168.1.100 -nowplaying
### SoundTouch Service
\`\`\`bash
# Start the service
./soundtouch-service
\`\`\`
## 🧪 Tested Hardware
@@ -402,6 +390,8 @@ jobs:
- Windows (amd64)
- FreeBSD (amd64)
Both `soundtouch-cli` and `soundtouch-service` are included.
## 🔐 Checksums
Multiple checksum options are provided for download verification:
@@ -454,6 +444,7 @@ jobs:
prerelease: ${{ needs.validate.outputs.is_prerelease == 'true' }}
files: |
release-assets/soundtouch-cli-v*
release-assets/soundtouch-service-v*
release-assets/checksums.sha256
release-assets/checksums.sha512
fail_on_unmatched_files: true
@@ -479,6 +470,7 @@ jobs:
tag_name: ${{ github.event.release.tag_name }}
files: |
release-assets/soundtouch-cli-v*
release-assets/soundtouch-service-v*
release-assets/checksums.sha256
release-assets/checksums.sha512
fail_on_unmatched_files: true
@@ -495,7 +487,7 @@ jobs:
- name: Notify success
run: |
echo "🎉 Release ${{ needs.validate.outputs.version }} completed successfully!"
echo "📦 Binaries built for 7 platforms"
echo "📦 Binaries built for 7 platforms (CLI and Service)"
echo "🔐 Checksums generated and verified"
echo "📋 Release notes automatically generated"
echo ""