diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..44dfb30 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Build release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 4c7d39e..ae710a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/coverage.txt \ No newline at end of file +/coverage.txt +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..92e9e05 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,23 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - skip: true + +changelog: + use: github + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +release: + name_template: "v{{ .Version }}" + footer: | + **Full Changelog**: https://github.com/andygrunwald/go-gerrit/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}