diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a2dad5b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: goreleaser + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + + - 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 2c0e3e0..76da7bc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,6 @@ go.work .vscode *.swp *.swo -*~ \ No newline at end of file +*~ + +dist \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..b2dee1d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,40 @@ +# 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 + +release: + draft: true + prerelease: auto + +changelog: + use: github + groups: + - title: "Breaking changes" + regexp: '^.*?\w+(\(.+\))?!:\s?.+$' + order: 0 + - title: "Features" + regexp: '^.*?feat(\(.+\))??!?:.+$' + order: 1 + - title: "Bug fixes" + regexp: '^.*?fix(\(.+\))??!?:.+$' + order: 2 + - title: "Documentation" + regexp: '^.*?docs(\(.+\))??!?:.+$' + order: 3 + - title: "Build system" + regexp: '^.*?(build|ci)(\(.+\))??!?:.+$' + order: 4 + - title: "Others" + order: 999 + filters: + exclude: + - '^.*?(test|style)(\(.+\))??!?:.+$' + - 'initial commit' \ No newline at end of file