Skip to content

Commit

Permalink
chore(CI/CD): Strip debug info from built binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
levaitamas committed May 11, 2024
1 parent 009ee7a commit 4e4d6a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish--add-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Build binaries
run: |
export CGO_ENABLED=0 GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
make build
make build-bin
mv bin/turncat turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
mv bin/stunnerctl stunnerctl-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apkArch="$(apk --print-arch)"; \
esac; \
export CGO_ENABLED=0; \
export GOOS=linux; \
make build
make build-bin

###########
# STUNNERD
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BUILD_DIR ?= bin/
VERSION ?= $(shell (git describe --tags --abbrev=8 --always --long) | tr "/" "-")
COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null)
BUILD_DATE ?= $(shell date +%FT%T%z)
LDFLAGS += -s -w
LDFLAGS += -X main.version=${VERSION} -X main.commitHash=${COMMIT_HASH} -X main.buildDate=${BUILD_DATE}
GOARGS = -trimpath

Expand Down Expand Up @@ -35,7 +36,10 @@ test: generate fmt vet
##@ Build

.PHONY: build
build: generate fmt vet
build: generate fmt vet build-bin

.PHONY: build-bin
build-bin:
go build ${GOARGS} -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/stunnerd cmd/stunnerd/main.go
go build ${GOARGS} -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/turncat cmd/turncat/main.go
go build ${GOARGS} -o ${BUILD_DIR}/stunnerctl cmd/stunnerctl/main.go
Expand Down

0 comments on commit 4e4d6a3

Please sign in to comment.