fix(visualizer): resolve music sync and fixed bar position. #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false # Add this line to prevent all jobs from stopping on a single failure | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux-x64 | |
| artifact_name: tuisic | |
| asset_name: tuisic-linux-x64 | |
| # - os: windows-latest | |
| # target: windows-x64 | |
| # artifact_name: tuisic.exe | |
| # asset_name: tuisic-windows-x64.exe | |
| - os: macos-latest | |
| target: macos-x64 | |
| artifact_name: tuisic | |
| asset_name: tuisic-macos-x64 | |
| - os: macos-latest | |
| target: macos-arm64 | |
| artifact_name: tuisic | |
| asset_name: tuisic-macos-arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup build environment | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake pkg-config libfftw3-dev libmpv-dev libcurl4-openssl-dev libfmt-dev libsystemd-dev rapidjson-dev libpulse-dev | |
| git clone --depth 1 https://github.com/Kistler-Group/sdbus-cpp.git | |
| cd sdbus-cpp | |
| mkdir build && cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . | |
| sudo cmake --build . --target install | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| # Install other dependencies | |
| brew install cmake pkg-config fftw mpv curl fmt rapidjson | |
| # Set environment variables for Homebrew paths | |
| # Detect Homebrew prefix (Apple Silicon uses /opt/homebrew, Intel uses /usr/local) | |
| BREW_PREFIX=$(brew --prefix) | |
| echo "HOMEBREW_PREFIX=${BREW_PREFIX}" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=${BREW_PREFIX}/lib/pkgconfig:${BREW_PREFIX}/opt/curl/lib/pkgconfig:${BREW_PREFIX}/opt/fmt/lib/pkgconfig" >> $GITHUB_ENV | |
| echo "CMAKE_PREFIX_PATH=${BREW_PREFIX}" >> $GITHUB_ENV | |
| echo "LDFLAGS=-L${BREW_PREFIX}/lib" >> $GITHUB_ENV | |
| echo "CPPFLAGS=-I${BREW_PREFIX}/include" >> $GITHUB_ENV | |
| # elif [ "$RUNNER_OS" == "Windows" ]; then | |
| # choco install cmake | |
| # # Note: Windows build requires vcpkg or manual dependency setup | |
| fi | |
| shell: bash | |
| - name: Configure CMake | |
| run: | | |
| mkdir build | |
| cd build | |
| if [ "${{ matrix.target }}" == "macos-arm64" ]; then | |
| cmake .. \ | |
| -DWITH_MPRIS=OFF \ | |
| -DCMAKE_OSX_ARCHITECTURES=arm64 \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_PREFIX_PATH="${HOMEBREW_PREFIX}" | |
| elif [ "${{ matrix.target }}" == "macos-x64" ]; then | |
| cmake .. \ | |
| -DWITH_MPRIS=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_PREFIX_PATH="${HOMEBREW_PREFIX}" | |
| else | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| fi | |
| shell: bash | |
| - name: Build | |
| run: | | |
| cd build | |
| cmake --build . --config Release -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: build/${{ matrix.artifact_name }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Prepare release assets | |
| run: | | |
| # Rename artifacts to have unique names with platform identifiers | |
| mkdir -p release-assets | |
| mv artifacts/tuisic-linux-x64/tuisic release-assets/tuisic-linux-x64 | |
| mv artifacts/tuisic-macos-x64/tuisic release-assets/tuisic-macos-x64 | |
| mv artifacts/tuisic-macos-arm64/tuisic release-assets/tuisic-macos-arm64 | |
| # Make all binaries executable | |
| chmod +x release-assets/* | |
| # List files for debugging | |
| ls -lh release-assets/ | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| # Get previous tag | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "") | |
| # Generate changelog from commits | |
| if [ -n "$PREVIOUS_TAG" ]; then | |
| CHANGELOG=$(git log --pretty=format:"- %s" ${PREVIOUS_TAG}..HEAD) | |
| else | |
| CHANGELOG=$(git log --pretty=format:"- %s") | |
| fi | |
| # Save changelog to file | |
| echo "$CHANGELOG" > CHANGELOG.md | |
| # Set output for GitHub release | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body: | | |
| ## Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Downloads | |
| Download the appropriate binary for your platform: | |
| - **Linux (x64)**: tuisic-linux-x64 | |
| - **macOS (Intel)**: tuisic-macos-x64 | |
| - **macOS (Apple Silicon)**: tuisic-macos-arm64 | |
| files: | | |
| release-assets/tuisic-linux-x64 | |
| release-assets/tuisic-macos-x64 | |
| release-assets/tuisic-macos-arm64 | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |