name: Release on: push: tags: - "v*" workflow_dispatch: inputs: tag: description: "Release tag to build and publish (e.g. v1.0.0)" required: true default: "v1.0.0" permissions: contents: write jobs: gate: runs-on: ubuntu-latest outputs: tag: ${{ steps.resolve.outputs.tag }} version: ${{ steps.resolve.outputs.version }} sha: ${{ steps.resolve.outputs.sha }} ytdlp: ${{ steps.ytdlp.outputs.version }} steps: - name: Find the latest yt-dlp release id: ytdlp env: GH_TOKEN: ${{ github.token }} run: | version="$(gh api repos/yt-dlp/yt-dlp/releases/latest --jq .tag_name)" test -n "$version" || { echo "No yt-dlp release found."; exit 1; } echo "Bundling yt-dlp $version" echo "version=$version" >> "$GITHUB_OUTPUT" - name: Resolve the tag and commit id: resolve run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then tag="${{ inputs.tag }}" else tag="${{ github.ref_name }}" fi echo "tag=$tag" >> "$GITHUB_OUTPUT" echo "version=${tag#v}" >> "$GITHUB_OUTPUT" echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" echo "Releasing $tag" ffmpeg: needs: gate strategy: fail-fast: false matrix: include: - { platform: darwin-arm64, os: macos-latest } - { platform: darwin-amd64, os: macos-latest } - { platform: linux-amd64, os: ubuntu-latest } - { platform: linux-arm64, os: ubuntu-24.04-arm } - { platform: windows-amd64, os: ubuntu-latest } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: ref: ${{ needs.gate.outputs.sha }} - uses: actions/cache@v4 id: cache with: path: resources/${{ matrix.platform }} key: ffmpeg-${{ matrix.platform }}-${{ hashFiles('scripts/build-ffmpeg.sh') }} - name: Build ffmpeg in Alpine if: startsWith(matrix.platform, 'linux-') && steps.cache.outputs.cache-hit != 'true' run: | docker run --rm -v "$PWD:/src" -w /src alpine:3.22 sh -euc ' apk add --no-cache bash build-base curl nasm openssl-dev openssl-libs-static pkgconf tar xz scripts/build-ffmpeg.sh "${{ matrix.platform }}" chown -R '"$(id -u):$(id -g)"' resources' - name: Build ffmpeg with MinGW-w64 if: startsWith(matrix.platform, 'windows-') && steps.cache.outputs.cache-hit != 'true' run: | sudo apt-get update sudo apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 nasm xz-utils scripts/build-ffmpeg.sh "${{ matrix.platform }}" - name: Build ffmpeg if: startsWith(matrix.platform, 'darwin-') && steps.cache.outputs.cache-hit != 'true' run: scripts/build-ffmpeg.sh "${{ matrix.platform }}" - name: Check the build run: | ffmpeg="resources/${{ matrix.platform }}/bin/ffmpeg" if [ "${{ matrix.platform }}" = windows-amd64 ]; then ffmpeg="$ffmpeg.exe"; fi ls -la "$ffmpeg" if [ "${{ matrix.platform }}" != darwin-amd64 ] && [ "${{ matrix.platform }}" != windows-amd64 ]; then "$ffmpeg" -hide_banner -protocols | grep -x ' https' "$ffmpeg" -hide_banner -decoders | grep -E ' (opus|aac) ' fi - uses: actions/upload-artifact@v4 with: name: ffmpeg-${{ matrix.platform }} path: resources/${{ matrix.platform }} include-hidden-files: true if-no-files-found: error build: needs: [gate, ffmpeg] strategy: fail-fast: false matrix: include: - { platform: darwin-universal, os: macos-latest } - { platform: linux-amd64, os: ubuntu-latest } - { platform: linux-arm64, os: ubuntu-latest } - { platform: windows-amd64, os: ubuntu-latest } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: ref: ${{ needs.gate.outputs.sha }} - uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Set the version run: | version="${{ needs.gate.outputs.version }}" echo "VERSION=$version" >> "$GITHUB_ENV" jq --arg v "$version" '.version = $v' mygo.json > mygo.json.new mv mygo.json.new mygo.json - uses: actions/download-artifact@v4 if: matrix.platform == 'darwin-universal' with: name: ffmpeg-darwin-arm64 path: resources/darwin-arm64 - uses: actions/download-artifact@v4 if: matrix.platform == 'darwin-universal' with: name: ffmpeg-darwin-amd64 path: resources/darwin-amd64 - uses: actions/download-artifact@v4 if: matrix.platform != 'darwin-universal' with: name: ffmpeg-${{ matrix.platform }} path: resources/${{ matrix.platform }} - name: Set up the Windows installer tool if: startsWith(matrix.platform, 'windows-') run: sudo apt-get update && sudo apt-get install -y --no-install-recommends nsis - name: Fetch media tools and build env: YT_DLP_VERSION: ${{ needs.gate.outputs.ytdlp }} GH_TOKEN: ${{ github.token }} run: | platform="${{ matrix.platform }}" if [ "$platform" = "darwin-universal" ]; then fetch_platforms=(darwin-arm64 darwin-amd64) else fetch_platforms=("$platform") fi for fp in "${fetch_platforms[@]}"; do for ff in "resources/$fp/bin/ffmpeg" "resources/$fp/bin/ffmpeg.exe"; do if [ -f "$ff" ]; then chmod +x "$ff"; fi done ./scripts/fetch-tools.sh "$fp" done if [[ "$platform" == windows-* ]]; then export GOFLAGS="${GOFLAGS:+$GOFLAGS }-modfile=$(./scripts/dux-go-modfile.sh)" fi go tool mygo build -o dist -platform "${platform/-//}" - name: Set up Linux package tools if: startsWith(matrix.platform, 'linux-') run: | sudo apt-get update sudo apt-get install -y --no-install-recommends flatpak imagemagick sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo for arch in x86_64 aarch64; do sudo flatpak install --noninteractive --arch="$arch" flathub org.gnome.Platform//48 org.gnome.Sdk//48 done go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.48.0 echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" curl --fail --location --silent --show-error \ https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage \ --output "$RUNNER_TEMP/appimagetool" chmod +x "$RUNNER_TEMP/appimagetool" echo "APPIMAGETOOL=$RUNNER_TEMP/appimagetool" >> "$GITHUB_ENV" - name: Collect the downloads run: | mkdir artifacts arch="${{ matrix.platform }}"; arch="${arch#*-}" case "${{ matrix.platform }}" in darwin-*) dmg="$(find "dist/${{ matrix.platform }}" -maxdepth 1 -name '*.dmg')" cp "$dmg" "artifacts/Echo-Music-${VERSION}-macos-${arch}.dmg" ;; windows-*) installer="$(find "dist/${{ matrix.platform }}" -maxdepth 1 -name '*-setup-*.exe')" cp "$installer" "artifacts/Echo-Music-${VERSION}-windows-${arch}-setup.exe" python3 - "dist/${{ matrix.platform }}" "artifacts/Echo-Music-${VERSION}-windows-${arch}-portable.zip" <<'PY' from pathlib import Path import sys from zipfile import ZIP_DEFLATED, ZipFile source = Path(sys.argv[1]) output = Path(sys.argv[2]) with ZipFile(output, "w", ZIP_DEFLATED) as archive: for path in sorted(source.rglob("*")): if path.is_dir(): continue relative = path.relative_to(source) if relative.parent == Path(".") and ( (relative.name.startswith("update-") and path.suffix == ".json") or path.suffix == ".delta" or path.name.endswith(".tar.gz") or ("-setup-" in relative.name and path.suffix == ".exe") ): continue archive.write(path, Path("Echo Music") / relative) PY ;; linux-*) scripts/package-linux.sh "${{ matrix.platform }}" "$VERSION" artifacts full ;; esac ls -lh artifacts/ - uses: actions/upload-artifact@v4 with: name: echomusic-${{ matrix.platform }} path: artifacts/* if-no-files-found: error release: needs: [gate, build] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 with: ref: ${{ needs.gate.outputs.sha }} - uses: actions/download-artifact@v4 with: pattern: echomusic-* path: artifacts merge-multiple: true - name: Checksums run: cd artifacts && sha256sum ./* > SHA256SUMS.txt && cat SHA256SUMS.txt - name: Publish env: GH_TOKEN: ${{ github.token }} TAG: ${{ needs.gate.outputs.tag }} VERSION: ${{ needs.gate.outputs.version }} run: | cat > release-notes.md <<'EOF' ## Echo Music Desktop 1.0.1 Official native desktop client for **Echo Music**, built in Go with hardware-accelerated rendering and zero Electron overhead. ### What's New in 1.0.1 - **Echo Connect (LAN Sync & Pairing)**: 6-digit pairing between Echo Music Desktop and Android over local Wi-Fi for instant playback handoff, remote control, Google account sync, synced local & Spotify playlists, and podcast progress sync. - **Continue Listening for Podcasts**: Added a dedicated **Continue listening** shelf at the top of the Podcasts page with episode progress bars and automatic metadata hydration (titles, show names, thumbnails, and durations). - **Strict Spotify Track Matching**: Synced Spotify playlists now resolve tracks using strict title, artist, and duration scoring while filtering out unwanted remixes, lofi, slowed/reverb, and cover mismatches. - **Redesigned Settings & AI Control (MCP)**: Categorized Settings with a persistent left navigation rail, unique section icons, a dedicated **AI Control** section for local MCP setup & JSON config, and smoother scrolling. - **UI & Navigation Polish**: - Pinned the top navigation bar on scroll across Home, Podcasts, Explore, Library, Downloads, and Settings. - Moved the playback speed menu between Full Screen and Open Player in the mini player bar. - Removed playlist cover art from the compact scrolled playlist top bar for a cleaner layout. - Fixed horizontal trackpad scrolling accidentally triggering pull-to-refresh. ### Downloads - **macOS** (`universal` — Apple Silicon & Intel): `.dmg` - **Windows** (`amd64`): `-setup.exe` (NSIS installer) and `-portable.zip` (extract and run `Echo Music.exe`) - **Linux** (`amd64`, `arm64`): `.deb`, `.rpm`, `.flatpak`, `.AppImage`, and `.tar.gz` - All builds bundle `ffmpeg`, `yt-dlp`, and `QuickJS`. Verify downloads with `SHA256SUMS.txt`. EOF if gh release view "$TAG" >/dev/null 2>&1; then gh release edit "$TAG" --title "Echo Music Desktop $VERSION" --notes-file release-notes.md gh release upload "$TAG" artifacts/* --clobber else gh release create "$TAG" artifacts/* \ --target "${{ needs.gate.outputs.sha }}" \ --title "Echo Music Desktop $VERSION" \ --notes-file release-notes.md fi