From d36f868f4edb388f5dc0a4fb46228b4ade8a1401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=85=8E=E9=A5=BC=E6=9E=9C=E5=AD=90=E5=8D=B7=E9=B2=A8?= =?UTF-8?q?=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Mon, 30 Dec 2024 19:29:04 +0800 Subject: [PATCH] chore: update GoReleaser configuration for improved build and release process - Added GO111MODULE environment variable to ensure module support during builds. - Updated build flags to include short commit and commit date for better traceability. - Enhanced release configuration with additional files and improved changelog filtering. - Reorganized project settings and removed obsolete build verification steps for clarity. --- .goreleaser.yml | 65 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 1934821..561e6b5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,6 +12,7 @@ builds: binary: cursor-id-modifier env: - CGO_ENABLED=0 + - GO111MODULE=on goos: - linux - windows @@ -26,32 +27,13 @@ builds: ldflags: - -s -w - -X 'main.version={{.Version}}' - - -X 'main.commit={{.Commit}}' - - -X 'main.date={{.Date}}' + - -X 'main.commit={{.ShortCommit}}' + - -X 'main.date={{.CommitDate}}' + - -X 'main.builtBy=goreleaser' flags: - -trimpath mod_timestamp: '{{ .CommitTimestamp }}' -# 添加构建时的项目设置 -project_name: cursor-id-modifier - -# 添加构建验证 -builds_verify: - - skip: false - cmd: "{{.Binary}} --version" - -# 改进发布配置 -release: - draft: true - prerelease: auto - mode: replace - header: | - ## Release {{.Tag}} ({{.Date}}) - - See [CHANGELOG.md](CHANGELOG.md) for details. - footer: | - **Full Changelog**: https://github.com/owner/repo/compare/{{ .PreviousTag }}...{{ .Tag }} - archives: - id: binary format: binary @@ -61,11 +43,50 @@ archives: {{- if eq .Arch "amd64" }}x64{{ end }} {{- if eq .Arch "386" }}x86{{ end }} {{- if eq .Arch "arm64" }}arm64{{ end }} + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 checksum: name_template: 'checksums.txt' algorithm: sha256 +release: + draft: true + prerelease: auto + mode: replace + header: | + ## Release {{.Tag}} ({{.Date}}) + + See [CHANGELOG.md](CHANGELOG.md) for details. + footer: | + **Full Changelog**: https://github.com/owner/repo/compare/{{ .PreviousTag }}...{{ .Tag }} + extra_files: + - glob: 'LICENSE*' + - glob: 'README*' + - glob: 'CHANGELOG*' + changelog: sort: asc use: github + filters: + exclude: + - '^docs:' + - '^test:' + - '^ci:' + - Merge pull request + - Merge branch + groups: + - title: Features + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: Others + order: 999 + +project_name: cursor-id-modifier