Skip to content

Fixes #345

Fixes #345 #166

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
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Run tests
shell: bash
run: |
go test -v -race -covermode=atomic ./...
- name: Build artifact
shell: bash
run: |
go build -trimpath -ldflags "-w -s -X 'github.com/scribble-rs/scribble.rs/internal/version.Version=$VERSION'" -o ${{ matrix.binary_name }} ./cmd/scribblers
- name: Upload build artifact
uses: actions/upload-artifact@v4
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
with:
name: ${{ matrix.binary_name }}
path: ./${{ matrix.binary_name }}