Skip to content

Commit 1434221

Browse files
authored
feat: add release binary CI (#4)
1 parent 80711d5 commit 1434221

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434

3535
- name: Release
3636
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
3838

.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
-
22+
name: Set up Go
23+
uses: actions/setup-go@v5
24+
-
25+
name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
distribution: goreleaser
29+
version: '~> v2'
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ go.work
2222
go.work.sum
2323

2424
.idea/
25+
26+
dist/

.goreleaser.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
before:
12+
hooks:
13+
# You may remove this if you don't use go modules.
14+
- go mod tidy
15+
# you may remove this if you don't need go generate
16+
#- go generate ./...
17+
18+
builds:
19+
- env:
20+
- CGO_ENABLED=0
21+
goos:
22+
- linux
23+
- windows
24+
- darwin
25+
26+
archives:
27+
- format: tar.gz
28+
# this name template makes the OS and Arch compatible with the results of `uname`.
29+
name_template: >-
30+
{{ .ProjectName }}_
31+
{{- title .Os }}_
32+
{{- if eq .Arch "amd64" }}x86_64
33+
{{- else if eq .Arch "386" }}i386
34+
{{- else }}{{ .Arch }}{{ end }}
35+
{{- if .Arm }}v{{ .Arm }}{{ end }}
36+
# use zip for windows archives
37+
format_overrides:
38+
- goos: windows
39+
format: zip
40+
41+
changelog:
42+
sort: asc
43+
filters:
44+
exclude:
45+
- "^docs:"
46+
- "^test:"

0 commit comments

Comments
 (0)