Skip to content

Commit

Permalink
test: goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Nov 20, 2024
1 parent 06522eb commit 2db6a90
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable

# 添加控制emoji标题的变量
- name: Set Changelog Emoji Option
run: echo "USE_EMOJI_TITLE=true" >> $GITHUB_ENV


- name: Debug Environment Variables
run: echo "USE_EMOJI=$USE_EMOJI_TITLE"

# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
Expand All @@ -46,7 +45,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

# Emoji标题变量
USE_EMOJI_TITLE: ${{ env.USE_EMOJI_TITLE }}
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
23 changes: 15 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,25 @@ changelog:
- "^更新文件"
- "^测试(:|\\()"

# 根据正则表达式和标题分组提交消息
#
# 顺序值定义分组顺序
# 未提供正则表达式意味着所有提交都将分组到默认分组下
#
# 匹配仅对提交消息的第一行执行,前缀为提交 SHA1,通常采用 `<abbrev-commit>[:] <title-commit>` 形式
# 当使用 github-native 时,分组被禁用,因为它已经按自身分组
# 正则表达式使用 RE2 语法,如下所示:https://github.com/google/re2/wiki/Syntax
groups:
# feat(UI): 新增用户登录界面、新增: 实现用户认证功能。
# - title: "New Features" # “新功能”
- title: "New Features" # “新功能”
# - title: "✨ New Features (新功能)"
- title: "{{ if .Env.USE_EMOJI }}✨ New Features (新功能){{ else }}New Features{{ end }}"
regexp: '^(?i).*?(feat|功能|新增|feature|新特性)(\(.+\))??!?[-:\s].+$'
order: 100


# fix: 修复UI组件加载延迟问题
# - title: "Bug fixes" # “Bug 修复”
- title: "Bug fixes" # “Bug 修复”
# - title: "🐛 Bug Fixes (修复问题)"
- title: "{{ if .Env.USE_EMOJI }}🐛 Bug Fixes (修复问题){{ else }}Bug fixes{{ end }}"
regexp: '^(?i).*?(fix|修复|bug|错误|bugfix)(\(.+\))??!?[-:\s].+$'
order: 200

Expand All @@ -94,13 +100,13 @@ changelog:

# refactor: 代码重构,版本更新。
- title: "Code Refactor" # “代码重构(既不是增加feature,也不是修复bug)”
- title: "🚀 Code Refactor (代码重构)"
# - title: "🚀 Code Refactor (代码重构)"
regexp: '^(?i).*?(refactor|重构|major|大版本)(\(.+\))??!?[-:\s].+$'
order: 500

# pref: 优化用户登录流程,减少加载时间。
# - title: "Code Optimization" # “性能优化”
- title: "⚡️ Code Optimization (性能优化)"
- title: "Code Optimization" # “性能优化”
# - title: "⚡️ Code Optimization (性能优化)"
regexp: '^(?i).*?(perf?|performance|优化|性能|opt?|optimization)(\(.+\))??!?[-:\s].+$'
order: 600

Expand Down Expand Up @@ -163,7 +169,8 @@ release:
> {{.TagContents}}
Released in {{ .CommitDate }}
Released at {{ .CommitDate }}
footer: |
**Full Changelog**: https://github.com/sinspired/ip-scanner/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}

0 comments on commit 2db6a90

Please sign in to comment.