50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Build zurg-testing executable binary
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v0*
|
|
- latest
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goos: [windows, darwin, linux]
|
|
goarch: [386, amd64, arm, arm64] # This list can be expanded based on your requirements
|
|
exclude:
|
|
- goos: darwin
|
|
goarch: 386
|
|
- goos: darwin
|
|
goarch: arm
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: 'stable' # Adjust according to your Go version
|
|
|
|
- name: Build
|
|
run: |
|
|
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -o zurg-${{ matrix.goos }}-${{ matrix.goarch }} cmd/zurg/main.go
|
|
|
|
# Install and use UPX to compress the binary
|
|
- name: Install and Compress with UPX
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y upx-ucl
|
|
upx --best zurg-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: zurg-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: |
|
|
zurg-${{ matrix.goos }}-${{ matrix.goarch }}
|