Skip to content

Commit 88fe99d

Browse files
committed
add the releaser workflow
1 parent f8bbbae commit 88fe99d

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/release.yml

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

.goreleaser.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2
2+
3+
project_name: code-lang
4+
5+
checksum:
6+
name_template: 'checksums.txt'
7+
8+
changelog:
9+
sort: asc
10+
filters:
11+
exclude:
12+
- '^docs:'
13+
- '^test:'
14+
15+
before:
16+
hooks:
17+
- go mod tidy
18+
19+
builds:
20+
- main: ./main.go
21+
binary: code-lang
22+
env:
23+
- CGO_ENABLED=0
24+
goos:
25+
- linux
26+
- windows
27+
- darwin
28+
goarch:
29+
- amd64
30+
- arm64
31+
ignore:
32+
- goos: windows
33+
goarch: arm64
34+
flags:
35+
- -trimpath
36+
37+
archives:
38+
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
39+
files:
40+
- README.md
41+
- LICENSE
42+
43+
release:
44+
github:
45+
owner: walonCode
46+
name: code-lang
47+
mode: keep-existing
48+
replace_existing_artifacts: true

0 commit comments

Comments
 (0)