Fixes #348 #182
Workflow file for this run
This file contains 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: 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.22.x | |
- name: Run tests | |
shell: bash | |
run: | | |
go test -v -race -covermode=atomic ./... | |
- 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 }} |