Skip to content

Commit 9b8b0e3

Browse files
feat: use goreleaser
1 parent 7f804cd commit 9b8b0e3

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,8 @@ jobs:
4646
- uses: actions/setup-go@v3
4747
with:
4848
go-version: 1.18
49-
- run: |
50-
go install github.com/mitchellh/gox@latest
51-
go install github.com/tcnksm/ghr@latest
5249
- uses: go-semantic-release/action@v1
53-
id: semrel
5450
with:
55-
github-token: ${{ secrets.GITHUB_TOKEN }}
56-
ghr: true
57-
- run: |
58-
gox -parallel 4 -osarch="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X github.com/go-semantic-release/provider-git/pkg/provider.PVERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" ./cmd/provider-git/
59-
cd bin/ && shasum -a 256 * > ./provider-git_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
60-
if: steps.semrel.outputs.version != ''
61-
env:
62-
CGO_ENABLED: 0
63-
- run: ghr $(cat .ghr) bin/
64-
if: steps.semrel.outputs.version != ''
51+
hooks: goreleaser
6552
env:
6653
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
builds:
2+
- env:
3+
- CGO_ENABLED=0
4+
targets:
5+
- linux_amd64
6+
- linux_arm64
7+
- darwin_amd64
8+
- darwin_arm64
9+
- linux_arm
10+
- windows_amd64
11+
main: ./cmd/provider-git
12+
ldflags:
13+
- -extldflags '-static'
14+
- -s -w -X github.com/go-semantic-release/provider-git/pkg/provider.PVERSION={{.Version}}
15+
16+
archives:
17+
- format: binary
18+
name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
19+
20+
checksum:
21+
name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt'

0 commit comments

Comments
 (0)