Skip to content

Add playhead visualization to waveform view (#151) #607

Add playhead visualization to waveform view (#151)

Add playhead visualization to waveform view (#151) #607

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
tags:
- "v*"
- "*.*.*"
pull_request:
branches: [ main ]
env:
CGO_CXXFLAGS: "-D__RTMIDI_DEBUG__=0 -D__RTMIDI_QUIET__"
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Install rtmidi dependencies
run: |
brew update
brew install pkg-config
brew install rtmidi
brew install sox
- uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Set up environment variables
run: echo "CGO_ENABLED=1" >> $GITHUB_ENV
- name: Test
run: go test -v ./...
- name: Build Go project
run: go build -v -ldflags "-X main.Version=${{ github.ref_name }}" -o collidertracker
- name: Verify binary
run: ./collidertracker --help
- name: Zip binary (macOS)
run: zip -9 collidertracker_macos.zip collidertracker
- name: Upload artifact (macOS)
uses: actions/upload-artifact@v4
with:
name: collidertracker_macos.zip
path: collidertracker_macos.zip
if-no-files-found: error
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev sox zip
- uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Test
run: go test -v ./...
- name: Build Go project
run: go build -v -ldflags "-X main.Version=${{ github.ref_name }}" -o collidertracker
- name: Verify binary
run: ./collidertracker --help
- name: Zip binary (Linux)
run: zip -9 collidertracker_linux.zip collidertracker
- name: Upload artifact (Linux)
uses: actions/upload-artifact@v4
with:
name: collidertracker_linux.zip
path: collidertracker_linux.zip
if-no-files-found: error
alpine:
runs-on: ubuntu-latest
container:
image: golang:1.25-alpine
steps:
- name: Install build dependencies
run: |
apk add --no-cache \
git \
build-base \
autoconf \
automake \
libtool \
linux-headers \
alsa-lib-dev \
sox \
zip
- uses: actions/checkout@v5
- name: Build ALSA library statically
run: |
cd /tmp
git clone https://github.com/alsa-project/alsa-lib.git
cd alsa-lib
git checkout v1.2.10
libtoolize --force --copy --automake
aclocal
autoheader
automake --foreign --copy --add-missing
autoconf
./configure --prefix=/usr/local --enable-shared=no --enable-static=yes --disable-ucm
make -j$(nproc)
make install
- name: Build static Go binary
run: |
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
export CGO_CFLAGS="-I/usr/local/include"
export CGO_LDFLAGS="-L/usr/local/lib"
export CGO_CXXFLAGS="${CGO_CXXFLAGS}"
CGO_ENABLED=1 go build -buildvcs=false -ldflags '-X main.Version=${{ github.ref_name }} -linkmode external -extldflags "-static -L/usr/local/lib"' -o collidertracker
- name: Verify static binary
run: |
file collidertracker
(ldd collidertracker 2>/dev/null || echo "✓ Static binary!")
ls -lh collidertracker
./collidertracker --help
- name: Zip binary (Linux static)
run: zip -9 collidertracker_linux_static.zip collidertracker
- name: Upload artifact (Linux static)
uses: actions/upload-artifact@v4
with:
name: collidertracker_linux_static.zip
path: collidertracker_linux_static.zip
if-no-files-found: error
windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
- name: Install required packages
shell: msys2 {0}
run: |
pacman -S --noconfirm mingw-w64-x86_64-rtmidi mingw-w64-x86_64-toolchain
- name: Install sox
run: choco install sox
shell: powershell
- name: Set up environment variables for Go
shell: pwsh
run: |
$env:Path += ";C:\msys64\mingw64\bin"
echo "CGO_ENABLED=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CC=x86_64-w64-mingw32-gcc" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CGO_LDFLAGS=-static" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CGO_CXXFLAGS=-D__RTMIDI_DEBUG__=0 -D__RTMIDI_QUIET__" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Test
run: go test -v ./...
- name: Build Go project
run: go build -v -ldflags "-X main.Version=${{ github.ref_name }}" -o collidertracker.exe
- name: Verify binary
run: .\collidertracker.exe --help
- name: Zip binary (Windows)
shell: pwsh
run: Compress-Archive -Path collidertracker.exe -DestinationPath collidertracker_windows.zip -Force
- name: Upload artifact (Windows)
uses: actions/upload-artifact@v4
with:
name: collidertracker_windows.zip
path: collidertracker_windows.zip
if-no-files-found: error
release:
name: Create GitHub Release (on tags)
runs-on: ubuntu-latest
needs: [macos, linux, alpine, windows]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./dist
merge-multiple: true
- name: List artifacts
run: ls -l ./dist
- name: Create Release and upload assets
uses: softprops/action-gh-release@v2
with:
files: |
dist/collidertracker_macos.zip
dist/collidertracker_linux.zip
dist/collidertracker_linux_static.zip
dist/collidertracker_windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}