Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from aidenkeating/goreleaser
Browse files Browse the repository at this point in the history
add goreleaser to push binaries on each tag
  • Loading branch information
aidenkeating authored Jan 30, 2020
2 parents a112b9a + 3889e3a commit a0bf9f2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: goreleaser
on:
push:
tags:
- '*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ _testmain.go
*.test
*.prof

## Builds
cli

## Goland
.idea
cli

## Goreleaser
dist/
bin/
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- main: ./cmd/cli/main.go
env:
- CGO_ENABLED=0
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ vendor/check: vendor/fix
vendor/fix:
go mod tidy
go mod vendor

.PHONY: setup/goreleaser
setup/goreleaser:
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ To run unit tests, run:

```
make test/unit
```
```

## Releases

New binaries for a release tag will be created by [GoReleaser](https://goreleaser.com/) automatically.

To try out GoReleaser locally, it can be installed using `make setup/goreleaser`.

0 comments on commit a0bf9f2

Please sign in to comment.