Skip to content

misc: Go workflow for building and testing #14

misc: Go workflow for building and testing

misc: Go workflow for building and testing #14

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
binary_name: quill
shared_lib_name: libquill.so
header_name: libquill.h
artifact_name: quill-linux-amd64
- os: windows-latest
goos: windows
goarch: amd64
binary_name: quill.exe
shared_lib_name: libquill.dll
header_name: libquill.h
artifact_name: quill-windows-amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Build Quill Binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -o ${{ matrix.binary_name }} ./cmd/quill
- name: Build Shared Library
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
run: go build -buildmode=c-shared -o ${{ matrix.shared_lib_name }} ./cmd/c
- name: Upload Quill Binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
${{ matrix.binary_name }}
${{ matrix.shared_lib_name }}
${{ matrix.header_name }}