diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2710e24..442087c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,9 @@ updates: - package-ecosystem: "gomod" directory: "/" schedule: - interval: "daily" - reviewers: - - "Fank" + interval: "weekly" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" - reviewers: - - "Fank" + interval: "weekly" diff --git a/.github/templates/go-licenses.md.tpl b/.github/templates/go-licenses.md.tpl new file mode 100644 index 0000000..5ac0a47 --- /dev/null +++ b/.github/templates/go-licenses.md.tpl @@ -0,0 +1,5 @@ +## [go-licenses](https://github.com/google/go-licenses) report + +{{- range . }} +- {{ .Name }} ({{ .Version }}) [{{ .LicenseName }}]({{ .LicenseURL }}) +{{- end }} diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..c116636 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' # Trigger on version tags like v1.0.0, v2.1.0, etc. + +permissions: + contents: write + +jobs: + release: + name: Create GitHub Release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + + - name: Generate Changelog + id: changelog + uses: mikepenz/release-changelog-builder-action@v5 + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + name: Release ${{ github.ref_name }} + body: ${{ steps.changelog.outputs.changelog }} # Attach changelog diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c6ad9e3..24b35c2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,7 +13,7 @@ permissions: jobs: golangci: - name: lint + name: Go Lint runs-on: ubuntu-latest steps: - name: Checkout repository @@ -34,11 +34,10 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 - with: - version: latest test: runs-on: ubuntu-latest + name: Go Test steps: - name: Checkout repository uses: actions/checkout@v4 @@ -63,31 +62,3 @@ jobs: uses: robherley/go-test-action@v0 with: testArguments: ./... - - license-check: - runs-on: ubuntu-latest - name: License Check - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: ./go.mod - - - name: Install go-licenses - run: go install github.com/google/go-licenses@latest - shell: bash - - - name: Check licenses - run: > - go-licenses check ./... - --ignore ${{ github.repository }} - shell: bash - - - name: Get licenses list - run: > - go-licenses csv ./... - --ignore ${{ github.repository }} - shell: bash diff --git a/.github/workflows/license_go.yml b/.github/workflows/license_go.yml new file mode 100644 index 0000000..7d4273e --- /dev/null +++ b/.github/workflows/license_go.yml @@ -0,0 +1,49 @@ +name: License Go + +on: + push: + branches: + - main + - master + pull_request: + +jobs: + license-check: + runs-on: ubuntu-latest + name: License Check + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + + - name: Install go-licenses + run: go install github.com/google/go-licenses@latest + + - name: Check licenses + run: go-licenses check ./... + + license-report: + runs-on: ubuntu-latest + name: License Report + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + + - name: Install go-licenses + run: go install github.com/google/go-licenses@latest + + - name: Report to GitHub Step Summary + run: > + go-licenses report ./... + --template .github/templates/go-licenses.md.tpl + >> $GITHUB_STEP_SUMMARY + shell: bash