Skip to content

Commit 8c07662

Browse files
committed
(chore): use goreleaser for new releases instead of current action
Signed-off-by: Shubham Singh <shubhammahar1306@gmail.com>
1 parent 3789b54 commit 8c07662

2 files changed

Lines changed: 59 additions & 20 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,22 @@ on:
66
- 'v*'
77

88
jobs:
9-
build:
9+
release:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
1313

1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # GoReleaser needs full git history for changelog
1618

1719
- uses: actions/setup-go@v5
1820
with:
1921
go-version-file: go.mod
2022

21-
- name: Download dependencies
22-
run: go mod download
23-
24-
- name: Build binaries
25-
run: |
26-
GOOS=linux GOARCH=amd64 go build -o dist/codeaid-linux-amd64 .
27-
GOOS=darwin GOARCH=amd64 go build -o dist/codeaid-darwin-amd64 .
28-
GOOS=darwin GOARCH=arm64 go build -o dist/codeaid-darwin-arm64 .
29-
GOOS=windows GOARCH=amd64 go build -o dist/codeaid-windows-amd64.exe .
30-
31-
- name: Create release
32-
uses: marvinpinto/action-automatic-releases@latest
23+
- uses: goreleaser/goreleaser-action@v6
3324
with:
34-
repo_token: ${{ secrets.GITHUB_TOKEN }}
35-
prerelease: false
36-
files: |
37-
dist/codeaid-linux-amd64
38-
dist/codeaid-darwin-amd64
39-
dist/codeaid-darwin-arm64
40-
dist/codeaid-windows-amd64.exe
25+
args: release --clean
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod download
6+
7+
builds:
8+
- binary: codeaid
9+
goos:
10+
- linux
11+
- darwin
12+
- windows
13+
goarch:
14+
- amd64
15+
- arm64
16+
ignore:
17+
- goos: windows
18+
goarch: arm64
19+
ldflags:
20+
- -s -w -X main.version={{.Version}}
21+
22+
archives:
23+
- formats:
24+
- tar.gz
25+
format_overrides:
26+
- goos: windows
27+
formats:
28+
- zip
29+
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
30+
31+
changelog:
32+
sort: asc
33+
groups:
34+
- title: Features
35+
regexp: '^.*\(feat\).*|^.*feat:.*'
36+
order: 0
37+
- title: Bug Fixes
38+
regexp: '^.*\(fix\).*|^.*fix:.*'
39+
order: 1
40+
- title: Other
41+
order: 999
42+
filters:
43+
exclude:
44+
- "^chore"
45+
- "^docs"
46+
- "Merge pull request"
47+
48+
release:
49+
github:
50+
owner: 1shubham7
51+
name: codeaid
52+
name_template: "v{{ .Version }}"

0 commit comments

Comments
 (0)