diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 17ef124..f1774ce 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -8,6 +8,8 @@ on: jobs: deploy: runs-on: ubuntu-latest + container: + image: goreleaser/goreleaser-cross steps: - uses: actions/checkout@master with: diff --git a/.goreleaser.yml b/.goreleaser.yml index a60dcd2..8cdb527 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,14 +2,14 @@ before: hooks: - go mod tidy -v builds: - - env: + - id: universal + env: - CGO_ENABLED=0 ldflags: - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} goos: - linux - windows - - darwin goarch: - arm - arm64 @@ -28,6 +28,32 @@ builds: goarch: arm64 main: ./cmd/agent binary: nezha-agent + - id: darwin-amd64 + env: + - CGO_ENABLED=1 + - CC=o64-clang + - CXX=o64-clang++ + ldflags: + - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} + goos: + - darwin + goarch: + - amd64 + main: ./cmd/agent + binary: nezha-agent + - id: darwin-arm64 + env: + - CGO_ENABLED=1 + - CC=oa64-clang + - CXX=oa64-clang++ + ldflags: + - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} + goos: + - darwin + goarch: + - arm64 + main: ./cmd/agent + binary: nezha-agent universal_binaries: - name_template: "nezha-agent" replace: false