diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..a6788be4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +on: + push: + tags: + - "*" + +name: Release + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 0c95fb96..5636d3aa 100755 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ vendor/ main tmp-docs/ + +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..44533fc0 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,30 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download +builds: + - env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows +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:"