name: Build on: push jobs: test-and-build: strategy: matrix: include: - platform: windows-latest binary_name: scribblers-x64.exe - platform: ubuntu-latest binary_name: scribblers-linux-x64 - platform: macos-latest binary_name: scribblers-macos-x64 runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 with: # Workaround to get tags, getting git describe to work. fetch-depth: 0 - name: Install Go uses: actions/setup-go@v5 with: go-version: 1.25.5 - name: Run tests shell: bash run: | go test -v -race ./... - name: Build artifact shell: bash env: # Disable CGO to get "more static" binaries. They aren't really static ... # since it can still happen that part of the stdlib access certain libs, but # whatever, this will probs do for our usecase. (Can't quite remember # anymore, but I have had issues with this in the past) :D CGO_ENABLED: 0 run: | go build -trimpath -ldflags "-w -s -X 'github.com/scribble-rs/scribble.rs/internal/version.Version=$(git describe --tags --dirty)'" -o ${{ matrix.binary_name }} ./cmd/scribblers - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.binary_name }} path: ./${{ matrix.binary_name }}