build(ci): implement PGO (#1812)

* build(ci): implement pgo

Implement PGO (performance guided optimizations) for Go builds.
This commit is contained in:
Kyle Sanderson 2024-11-16 14:57:41 -08:00 committed by GitHub
parent fc137f2077
commit 50f1e4e7d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 199 additions and 14 deletions

View file

@ -26,7 +26,7 @@ export GOARCH=$TARGETARCH; \
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v6" ]] && export GOARM=6; \
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v7" ]] && export GOARM=7; \
echo $GOARCH $GOOS $GOARM$GOAMD64; \
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrr cmd/autobrr/main.go && \
go build -pgo=cpu.pprof -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrr cmd/autobrr/main.go && \
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrrctl cmd/autobrrctl/main.go
# build runner