feat(goreleaser): enhance build flags with versioning and commit info

Signed-off-by: Boris Bliznioukov <blib@mail.com>
This commit is contained in:
Boris Bliznioukov 2026-02-17 15:00:06 +01:00
parent 2d758d714f
commit 2d876eaa98
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -55,6 +55,7 @@ jobs:
ref: ${{ inputs.tag }} ref: ${{ inputs.tag }}
- name: Setup Go from go.mod - name: Setup Go from go.mod
id: setup-go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version-file: go.mod go-version-file: go.mod
@ -89,6 +90,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }} DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }}
GOVERSION: ${{ steps.setup-go.outputs.go-version }}
- name: Apply release flags - name: Apply release flags
shell: bash shell: bash

View file

@ -13,6 +13,12 @@ builds:
- CGO_ENABLED=0 - CGO_ENABLED=0
tags: tags:
- stdjson - stdjson
ldflags:
- -s -w
- -X main.version={{ .Version }}
- -X main.gitCommit={{ .ShortCommit }}
- -X main.buildTime={{ .Date }}
- -X main.goVersion={{ .Env.GOVERSION }}
goos: goos:
- linux - linux
- windows - windows