From dafacf3ac054c53dbdaab703c11bcf3fd974d9ef Mon Sep 17 00:00:00 2001 From: Sandeep Singh Date: Wed, 20 Sep 2023 13:46:08 +0530 Subject: [PATCH] workflow updates (#225) --- .github/dependabot.yml | 48 ++++++++++++++++------------ .github/release.yml | 17 ++++++++++ .github/workflows/build-test.yml | 2 +- .github/workflows/dep-auto-merge.yml | 26 +++++++++++++++ .github/workflows/lint-test.yml | 2 +- .github/workflows/release-binary.yml | 2 +- .github/workflows/release-test.yml | 30 +++++++++++++++++ .goreleaser.yml | 3 +- 8 files changed, 105 insertions(+), 25 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/dep-auto-merge.yml create mode 100644 .github/workflows/release-test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 69d9543..f9ecf8d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,32 +6,40 @@ version: 2 updates: - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - target-branch: "dev" - commit-message: - prefix: "chore" - include: "scope" - # Maintain dependencies for go modules - package-ecosystem: "gomod" directory: "/" schedule: interval: "weekly" - target-branch: "dev" + target-branch: "main" commit-message: prefix: "chore" include: "scope" + labels: + - "Type: Maintenance" + allow: + - dependency-name: "github.com/projectdiscovery/*" - # Maintain dependencies for docker - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" - target-branch: "dev" - commit-message: - prefix: "chore" - include: "scope" \ No newline at end of file +# # Maintain dependencies for docker +# - package-ecosystem: "docker" +# directory: "/" +# schedule: +# interval: "weekly" +# target-branch: "dev" +# commit-message: +# prefix: "chore" +# include: "scope" +# labels: +# - "Type: Maintenance" +# +# # Maintain dependencies for GitHub Actions +# - package-ecosystem: "github-actions" +# directory: "/" +# schedule: +# interval: "weekly" +# target-branch: "dev" +# commit-message: +# prefix: "chore" +# include: "scope" +# labels: +# - "Type: Maintenance" \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..596ba07 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + authors: + - dependabot + categories: + - title: 🎉 New Features + labels: + - "Type: Enhancement" + - title: 🐞 Bugs Fixes + labels: + - "Type: Bug" + - title: 🔨 Maintenance + labels: + - "Type: Maintenance" + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index fb8819a..82624eb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.20.x - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/dep-auto-merge.yml b/.github/workflows/dep-auto-merge.yml new file mode 100644 index 0000000..fc26472 --- /dev/null +++ b/.github/workflows/dep-auto-merge.yml @@ -0,0 +1,26 @@ +name: 🤖 dep auto merge + +on: + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + pull-requests: write + issues: write + repository-projects: write + +jobs: + automerge: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.DEPENDABOT_PAT }} + + - uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + github-token: ${{ secrets.DEPENDABOT_PAT }} + target: all \ No newline at end of file diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 208c437..4ad69b3 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.20.x - name: Checkout code uses: actions/checkout@v3 - name: Run golangci-lint diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index b625682..ad9c71d 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -15,7 +15,7 @@ jobs: - name: "Set up Go" uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.20.x - name: "Create release on GitHub" uses: goreleaser/goreleaser-action@v4 diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..77e09fb --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,30 @@ +name: 🔨 Release Test + +on: + pull_request: + paths: + - '**.go' + - '**.mod' + - '**.yml' + workflow_dispatch: + +jobs: + release-test: + runs-on: ubuntu-latest-16-cores + steps: + - name: "Check out code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.20.x + + - name: release test + uses: goreleaser/goreleaser-action@v4 + with: + args: "release --clean --snapshot" + version: latest + workdir: . \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 0471bd8..39f9591 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,8 +17,7 @@ builds: archives: - format: zip - replacements: - darwin: macOS + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}' checksum: algorithm: sha256