diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..176e980 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,20 @@ +changelog: + exclude: + labels: + - skip-changelog + authors: + - dependabot + - github-actions + categories: + - title: 🚀 Features + labels: + - enhancement + - title: 🐛 Bug Fixes + labels: + - bug + - title: 📚 Documentation + labels: + - documentation + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/pr-autolabel.yml b/.github/workflows/pr-autolabel.yml new file mode 100644 index 0000000..b56fa84 --- /dev/null +++ b/.github/workflows/pr-autolabel.yml @@ -0,0 +1,31 @@ +name: PR autolabel + +on: + pull_request: + types: [opened, edited] + +permissions: + pull-requests: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + const title = context.payload.pull_request.title || ""; + const m = title.match(/^(\w+)(\(([^)]*)\))?!?:/); + if (!m) return; + const type = m[1]; + const scope = m[3] || ""; + const map = { feat: "enhancement", fix: "bug", docs: "documentation" }; + let label = map[type]; + if (type === "chore" && scope === "release") label = "skip-changelog"; + if (!label) return; + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: [label], + }); diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d56fcfc..74e18e7 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -38,10 +38,4 @@ snapshot: version_template: "{{ incpatch .Version }}-next" changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" - - "^chore:" - - "^ci:" + use: github-native diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 70ce326..e471446 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -33,7 +33,7 @@ blocks: - name: Lint commands: - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b "$(go env GOPATH)/bin" + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v2.12.2 - "$(go env GOPATH)/bin/golangci-lint run ./..." - name: Tests @@ -50,7 +50,7 @@ blocks: commands: - go test -coverprofile=coverage.out ./... - go tool cover -func=coverage.out - - artifact push workflow coverage.out + - artifact push workflow coverage.out --force - name: Security dependencies: []