Skip to content

Commit 4c8af3f

Browse files
feat: use goreleaser
1 parent c939b72 commit 4c8af3f

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,8 @@ jobs:
3737
- uses: actions/setup-go@v3
3838
with:
3939
go-version: 1.18
40-
- name: Get release dependencies
41-
run: |
42-
go install github.com/mitchellh/gox@latest
43-
go install github.com/tcnksm/ghr@latest
4440
- uses: go-semantic-release/action@v1
45-
id: semrel
4641
with:
47-
github-token: ${{ secrets.GITHUB_TOKEN }}
48-
ghr: true
49-
- run: |
50-
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/condition-github/pkg/condition.CIVERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" ./cmd/condition-github/
51-
cd bin/ && shasum -a 256 * > ./condition-github_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
52-
if: steps.semrel.outputs.version != ''
53-
env:
54-
CGO_ENABLED: 0
55-
- run: ghr $(cat .ghr) bin/
56-
if: steps.semrel.outputs.version != ''
42+
hooks: goreleaser
5743
env:
5844
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/condition-github/
12+
ldflags:
13+
- -extldflags '-static'
14+
- -s -w -X github.com/go-semantic-release/condition-github/pkg/condition.CIVERSION={{.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)