From 13178456e52c915ce4f1cfa7cd01c2b63518016e Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Sat, 20 Sep 2025 08:16:32 -0700 Subject: [PATCH] chore: update CI workflow and simplify goreleaser build configuration ## CHANGES - Add changelog database to git tracking - Remove unnecessary goreleaser comments - Add version metadata to default build - Rename windows build from garbled to standard - Remove garble obfuscation from windows build - Standardize ldflags across all build targets - Inject version info during compilation --- .../update-version-and-create-tag.yml | 1 + .goreleaser.yaml | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-version-and-create-tag.yml b/.github/workflows/update-version-and-create-tag.yml index 69373b83..49cde729 100644 --- a/.github/workflows/update-version-and-create-tag.yml +++ b/.github/workflows/update-version-and-create-tag.yml @@ -95,6 +95,7 @@ jobs: run: | go run ./cmd/generate_changelog --process-prs ${{ steps.increment_version.outputs.new_tag }} go run ./cmd/generate_changelog --sync-db + git add ./cmd/generate_changelog/changelog.db - name: Commit changes run: | # These files are modified by the version bump process diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e3812005..f21275f4 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -5,10 +5,7 @@ version: 2 project_name: fabric before: hooks: - # You may remove this if you don't use go modules. - go mod tidy - # you may remove this if you don't need go generate - # - go generate ./... builds: - id: default @@ -19,19 +16,28 @@ builds: - linux main: ./cmd/fabric binary: fabric - - id: windows-garbled + ldflags: + - -s -w + - -X main.version={{.Version}} + - -X main.commit={{.ShortCommit}} + - -X main.date={{.Date}} + - -X main.builtBy=goreleaser + - -X main.tag={{.Tag}} + + - id: windows-build env: - CGO_ENABLED=0 goos: - windows main: ./cmd/fabric binary: fabric - tool: garble - # From https://github.com/eyevanovich/garble-goreleaser-example/blob/main/.goreleaser.yaml - # command is a single string. - command: "-tiny" - flags: [ "-seed=random", "build" ] - ldflags: [ "-s", "-w" ] + ldflags: + - -s -w + - -X main.version={{.Version}} + - -X main.commit={{.ShortCommit}} + - -X main.date={{.Date}} + - -X main.builtBy=goreleaser + - -X main.tag={{.Tag}} archives: - formats: [tar.gz]