Skip to content

Commit 725623e

Browse files
authored
ci: automate tagged releases with GoReleaser and GitHub Actions (#28)
* ci: automate tagged releases with GoReleaser and GitHub Actions - Add a GitHub Actions workflow to automate releases using GoReleaser when tags are pushed - Introduce a GoReleaser configuration file with build skipping, changelog grouping, and changelog sorting enabled Signed-off-by: appleboy <[email protected]> * refactor: standardize and clarify changelog groupings and patterns - Refine and unify changelog group regex patterns for better consistency - Rename and reorder some changelog group titles for clarity and capitalization - Add explicit changelog groups for "Maintenance" and improve differentiation of update types Signed-off-by: appleboy <[email protected]> * build: enable multi-arch release builds for mcp-proxy - Enable release build by configuring build parameters for mcp-proxy binary - Specify build targets for linux amd64 and arm64 architectures - Remove previous skip setting to allow builds Signed-off-by: appleboy <[email protected]> --------- Signed-off-by: appleboy <[email protected]>
1 parent 9760b06 commit 725623e

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

.github/workflows/goreleaser.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
env:
9+
GOPATH: /go_path
10+
GOCACHE: /go_cache
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup go
22+
uses: actions/setup-go@v5
23+
with:
24+
check-latest: true
25+
go-version: "^1"
26+
27+
- name: cache go
28+
id: cache-go
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
/go_path
33+
/go_cache
34+
key: go_path-${{ steps.hash-go.outputs.hash }}
35+
36+
- name: Run GoReleaser
37+
uses: goreleaser/goreleaser-action@v6
38+
with:
39+
# either 'goreleaser' (default) or 'goreleaser-pro'
40+
args: release --clean
41+
env:
42+
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
builds:
2+
- id: mcp-proxy
3+
main: .
4+
binary: mcp-proxy
5+
ldflags:
6+
- -s -w -X main.BuildVersion={{.Version}}
7+
goos:
8+
- linux
9+
goarch:
10+
- amd64
11+
- arm64
12+
13+
changelog:
14+
# Set it to true if you wish to skip the changelog generation.
15+
# This may result in an empty release notes on GitHub/GitLab/Gitea.
16+
disable: false
17+
18+
# Changelog generation implementation to use.
19+
#
20+
# Valid options are:
21+
# - `git`: uses `git log`;
22+
# - `github`: uses the compare GitHub API, appending the author login to the changelog.
23+
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog.
24+
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
25+
# - `gitea`: uses the compare Gitea API, appending the author login to the changelog.
26+
#
27+
# Defaults to `git`.
28+
use: github
29+
30+
# Sorts the changelog by the commit's messages.
31+
# Could either be asc, desc or empty
32+
# Default is empty
33+
sort: asc
34+
35+
# Group commits messages by given regex and title.
36+
# Order value defines the order of the groups.
37+
# Proving no regex means all commits will be grouped under the default group.
38+
# Groups are disabled when using github-native, as it already groups things by itself.
39+
#
40+
# Default is no groups.
41+
groups:
42+
groups:
43+
- title: Features
44+
regexp: '^feat(\([\w-]+\))?!?:.*'
45+
order: 0
46+
- title: "Bug Fixes"
47+
regexp: '^fix(\([\w-]+\))?!?:.*'
48+
order: 1
49+
- title: "Refactor"
50+
regexp: '^refactor(\([\w-]+\))?!?:.*'
51+
order: 2
52+
- title: "Build Process Updates"
53+
regexp: '^(build|ci)(\([\w-]+\))?!?:.*'
54+
order: 3
55+
- title: "Documentation Updates"
56+
regexp: '^docs(\([\w-]+\))?!?:.*'
57+
order: 4
58+
- title: "Maintenance"
59+
regexp: '^chore(\([\w-]+\))?!?:.*'
60+
order: 5
61+
- title: Others
62+
order: 999

0 commit comments

Comments
 (0)