diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1939824..d0b6b66 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,7 @@ updates: labels: - "dependencies" commit-message: - prefix: "feat" + prefix: "chore" include: "scope" - package-ecosystem: "github-actions" assignees: diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 962d744..b5f60de 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -2,8 +2,16 @@ name: "codeql" on: push: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' pull_request: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' jobs: analyze: name: analyze diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml index a030b6c..da04539 100644 --- a/.github/workflows/gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -3,7 +3,15 @@ on: push: branches: ['main'] tags: ['v*'] + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' permissions: contents: read jobs: diff --git a/.github/workflows/grype.yaml b/.github/workflows/grype.yaml index be97685..5c0a80f 100644 --- a/.github/workflows/grype.yaml +++ b/.github/workflows/grype.yaml @@ -3,7 +3,15 @@ on: push: branches: ['main'] tags: ['v*'] + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' jobs: scan-source: name: scan-source diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c56c5b2..3ed143d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,7 +5,15 @@ on: - v* branches: - main + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' permissions: contents: read @@ -13,7 +21,7 @@ jobs: golangci: strategy: matrix: - go: [ '1.20', '1.21' ] + go: [ '1.20', '1.21', '1.22' ] os: [ ubuntu-latest, windows-latest ] permissions: contents: read # for actions/checkout to fetch code diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..9ae1ce7 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: "release a version" +on: + push: + tags: + - 'v*' +permissions: + contents: write +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # it is required fot the changelog to work correctly + - uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + with: + distribution: goreleaser + version: latest + args: release --debug --clean + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5d3ddf0..7e1ddc8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,9 +3,16 @@ name: test on: push: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' pull_request: branches: [ main ] - + paths-ignore: + - 'docs/**' + - 'README.md' + - '.goreleaser.yaml' jobs: unit-test: runs-on: ubuntu-latest diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..0d65c2d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,35 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +builds: + - # If true, skip the build. + # Useful for library projects. + skip: true +changelog: + sort: asc + use: github + filters: + exclude: + - '^Merge' + groups: + - title: 'New Features' + regexp: "^.*feat.*:+.*$" + order: 100 + - title: 'Bug Fixes' + regexp: "^.*fix.*:+.*$" + order: 200 + - title: 'Dependency Updates' + regexp: "^.*(feat|fix)\\(deps\\)*:+.*$" + order: 300 + - title: 'Documentation Updates' + regexp: "^.*docs.*:+.*$" + order: 400 + - title: Other work + order: 9999 +release: + footer: | + **Full Changelog**: https://github.com/shipengqi/log/compare/{{ .PreviousTag }}...{{ .Tag }} + + +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj