Skip to content

Commit

Permalink
Merge pull request #9 from Silthus/master
Browse files Browse the repository at this point in the history
feat(release): add automatic binary releases with goreleaser
  • Loading branch information
StephanHCB authored Jun 23, 2022
2 parents e8890a6 + 7cd4894 commit 3800f55
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ jobs:
run: go test -v ./...

release:
name: release
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || 'refs/heads/beta' || github.ref == 'refs/heads/alpha'
needs: build
steps:
- uses: actions/checkout@v2
- name: Make binaries
uses: sosedoff/actions/golang-build@master
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
node-version: 14
- name: release
go-version: 1.16
- run: go build
- uses: go-semantic-release/action@v1
with:
hooks: goreleaser
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release semantic-release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format: binary
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
27 changes: 0 additions & 27 deletions .releaserc.json

This file was deleted.

0 comments on commit 3800f55

Please sign in to comment.