diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d99aa6..a7a57af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,16 +8,19 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 with: - go-version: 1.17 + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: 1.22 - name: Run goreleaser - uses: goreleaser/goreleaser-action@v1 + uses: goreleaser/goreleaser-action@v6 with: version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Update new version in krew-index - uses: rajatjindal/krew-release-bot@v0.0.40 +# disable krew install for now as this would conflict with the original. I'd have to rename the project to do this safely. +# - name: Update new version in krew-index +# uses: rajatjindal/krew-release-bot@v0.0.40 diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..647acde --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,41 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 2fe7274..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,28 +0,0 @@ -before: - hooks: - - go mod download -builds: -- env: - - CGO_ENABLED=0 - goos: - - windows - - linux - - darwin - goarch: - - amd64 -archives: - - - format: zip - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" - replacements: - amd64: x86_64 -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:'