Skip to content

Commit

Permalink
chore: read pkg name automatically
Browse files Browse the repository at this point in the history
Signed-off-by: Yves Brissaud <[email protected]>
  • Loading branch information
eunomie committed Oct 10, 2024
1 parent 650e9e6 commit e1b35a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod \
GIT_VERSION=$(git describe --tags | cut -c 2-) && \
PKG_NAME=$(go mod graph | head -n 1 | cut -d ' ' -f 1) && \
xx-go build \
-o dist/${BIN_NAME} \
-ldflags="-w -s \
-X {{.PKG_NAME}}/internal/constants.Version=$GIT_VERSION" \
-X $PKG_NAME/internal/constants.Version=$GIT_VERSION" \
./cmd/${BIN_NAME} && \
xx-verify dist/${BIN_NAME} && \
# on windows add the .exe extension and zip the binary \
Expand Down

0 comments on commit e1b35a4

Please sign in to comment.