diff --git a/.github/workflows/release-bin.yaml b/.github/workflows/release-bin.yaml new file mode 100644 index 0000000..f8254f1 --- /dev/null +++ b/.github/workflows/release-bin.yaml @@ -0,0 +1,31 @@ +name: Release dontgo403 binary + +on: + push: + tags: + - "*" # triggers only if push new tag version, like `0.8.4` or else + +jobs: + build: + name: GoReleaser build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + with: + fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ + + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..c5b055d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,33 @@ +before: + hooks: + - go mod download + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + ldflags: + - -s -w -X main.Version={{.Version}} -X main.BuildDate={{.CommitDate}} + ignore: + - goos: darwin + goarch: 386 + +archives: + - format: binary + name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" + +checksum: + name_template: "checksums.txt" + +snapshot: + name_template: "{{ .Tag }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" \ No newline at end of file