diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9635c9f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +--- +name: Release +on: + # https://github.com/actions/runner/issues/1007 + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +jobs: + release: + name: Release on GitHub + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v3 + id: go + with: + go-version: ^1.18 + + - name: Check out code + uses: actions/checkout@v3 + + - name: Launch goreleaser + uses: goreleaser/goreleaser-action@v2.9.1 + with: + args: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..418d6e3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,27 @@ +before: + hooks: + - go mod tidy + +builds: + - main: "." + binary: badrobot + goos: + - darwin + - linux + goarch: + - amd64 + - arm64 + ignore: + - goos: darwin + goarch: arm + env: + - CGO_ENABLED=0 + +checksum: + name_template: "{{ .ProjectName }}_checksums.txt" + +archives: + - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + +snapshot: + name_template: "{{ .Tag }}-next"