diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..16b1768 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 760f605..be5812d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,12 @@ _testmain.go *.test *.prof +## Builds +cli + +## Goland .idea -cli \ No newline at end of file + +## Goreleaser +dist/ +bin/ \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..1575a4d --- /dev/null +++ b/.goreleaser.yml @@ -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:' diff --git a/Makefile b/Makefile index a6a4303..e47c17d 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 17bb13d..e12bfed 100644 --- a/README.md +++ b/README.md @@ -80,4 +80,10 @@ To run unit tests, run: ``` make test/unit -``` \ No newline at end of file +``` + +## 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`. \ No newline at end of file