Skip to content

Commit

Permalink
refactor: Build binary with CGO disabled and package files
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcgn committed Jun 15, 2024
1 parent 66f0b93 commit 24ac5c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ jobs:
run: go mod tidy

- name: Build binary and set main.Version and main.BuildTime
env:
CGO_ENABLED: 0
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
BUILD_TIME=$(date +%Y-%m-%dT%H:%M:%SZ)
GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.Version=${TAG_NAME} -X main.BuildTime=${BUILD_TIME}" -o iot-ephemeral-value-store-server main.go
chmod +x iot-ephemeral-value-store-server
- name: Package files
run: tar czvf iot-ephemeral-value-store-server.tar.gz iot-ephemeral-value-store-server
Expand Down

0 comments on commit 24ac5c7

Please sign in to comment.