Skip to content

Commit

Permalink
feat: use goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed May 22, 2022
1 parent 7f804cd commit 9b8b0e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,8 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- run: |
go install github.com/mitchellh/gox@latest
go install github.com/tcnksm/ghr@latest
- uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
ghr: true
- run: |
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/
cd bin/ && shasum -a 256 * > ./provider-git_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
if: steps.semrel.outputs.version != ''
env:
CGO_ENABLED: 0
- run: ghr $(cat .ghr) bin/
if: steps.semrel.outputs.version != ''
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
builds:
- env:
- CGO_ENABLED=0
targets:
- linux_amd64
- linux_arm64
- darwin_amd64
- darwin_arm64
- linux_arm
- windows_amd64
main: ./cmd/provider-git
ldflags:
- -extldflags '-static'
- -s -w -X github.com/go-semantic-release/provider-git/pkg/provider.PVERSION={{.Version}}

archives:
- format: binary
name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'

checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt'

0 comments on commit 9b8b0e3

Please sign in to comment.