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
This commit is contained in:
Kayvan Sylvan 2025-09-20 08:16:32 -07:00
parent 079b2b5b28
commit 13178456e5
2 changed files with 17 additions and 10 deletions

View file

@ -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

View file

@ -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]