Update build command in GitHub workflow #7
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: Development Build | |
on: | |
push: | |
branches: | |
- features | |
jobs: | |
build: | |
name: Dev Build on ${{ matrix.goos }} / ${{ matrix.goarch }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [darwin, linux, netbsd, openbsd, windows] | |
goarch: [amd64, arm64] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Replace values in main.go | |
run: | | |
sed -i "s/@@gittag@@-@@gitcommit@@/$(echo ${GITHUB_REF#refs/heads/})-${GITHUB_SHA:0:8}/" server/main.go | |
- name: Build project | |
run: | | |
CGO_ENABLED=1 \ | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \ | |
go build -mod=vendor -tags="sonic avx" -ldflags="-s" -o nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev ./server | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev-binary | |
path: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev |