mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-31 14:57:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7117ff6592 | ||
|
|
d7b1c94b9a | ||
|
|
3cc45ebd20 | ||
|
|
a30251854c | ||
|
|
1a1d37b885 |
@@ -10,6 +10,10 @@ on:
|
||||
required: true
|
||||
default: "v1.0.0"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
|
||||
env:
|
||||
GO_VERSION_FILE: "go.mod"
|
||||
|
||||
@@ -132,11 +136,38 @@ jobs:
|
||||
|
||||
echo "Building: $OUTPUT_NAME"
|
||||
|
||||
# Debug: Show current state
|
||||
echo "Working directory: $(pwd)"
|
||||
echo "Go version: $(go version)"
|
||||
echo "Files before build:"
|
||||
ls -la
|
||||
|
||||
# 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
|
||||
rm -f "$OUTPUT_NAME" "$OUTPUT_NAME.sha256" "$OUTPUT_NAME.sha512"
|
||||
go clean -cache
|
||||
|
||||
# Build with optimizations and version info
|
||||
go build \
|
||||
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)" \
|
||||
-o "$OUTPUT_NAME" \
|
||||
./cmd/soundtouch-cli
|
||||
./cmd/soundtouch-cli; then
|
||||
echo "❌ Build failed"
|
||||
echo "Files after failed build:"
|
||||
ls -la
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Debug: Show post-build state
|
||||
echo "Files after successful build:"
|
||||
ls -la
|
||||
|
||||
# Verify binary was created and is executable
|
||||
ls -la "$OUTPUT_NAME"
|
||||
@@ -148,12 +179,25 @@ jobs:
|
||||
- name: Generate individual checksum
|
||||
run: |
|
||||
OUTPUT_NAME="${{ steps.build.outputs.binary_name }}"
|
||||
sha256sum "$OUTPUT_NAME" > "$OUTPUT_NAME.sha256"
|
||||
sha512sum "$OUTPUT_NAME" > "$OUTPUT_NAME.sha512"
|
||||
|
||||
echo "📋 Generated individual checksums:"
|
||||
cat "$OUTPUT_NAME.sha256"
|
||||
cat "$OUTPUT_NAME.sha512"
|
||||
# Use atomic operations to avoid conflicts
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
echo "Building checksums for: $OUTPUT_NAME"
|
||||
echo "Matrix: ${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||
|
||||
# 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"
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
echo "✅ Checksums generated successfully"
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
@@ -184,13 +228,18 @@ jobs:
|
||||
echo "📁 Downloaded artifact structure:"
|
||||
find . -type f -name "soundtouch-cli-*"
|
||||
|
||||
# Flatten directory structure (artifacts are in subdirs)
|
||||
# Move all binary files to current directory
|
||||
find . -type f -name "soundtouch-cli-*" -exec mv {} . \;
|
||||
# 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/ \;
|
||||
|
||||
# Remove empty directories
|
||||
find . -type d -empty -delete
|
||||
|
||||
# Move to the collection directory for the rest of the processing
|
||||
cd release-files
|
||||
|
||||
# Debug: Show flattened structure
|
||||
echo "📁 Flattened structure:"
|
||||
ls -la soundtouch-cli-* || echo "No files found matching pattern"
|
||||
@@ -227,17 +276,17 @@ jobs:
|
||||
with:
|
||||
name: checksums
|
||||
path: |
|
||||
binaries/checksums.sha256
|
||||
binaries/checksums.sha512
|
||||
binaries/*.sha256
|
||||
binaries/*.sha512
|
||||
binaries/release-files/checksums.sha256
|
||||
binaries/release-files/checksums.sha512
|
||||
binaries/release-files/*.sha256
|
||||
binaries/release-files/*.sha512
|
||||
retention-days: 1
|
||||
|
||||
- name: Upload all release assets
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: release-assets
|
||||
path: binaries/
|
||||
path: binaries/release-files/
|
||||
retention-days: 1
|
||||
|
||||
create_release:
|
||||
|
||||
Reference in New Issue
Block a user