From 50b2c0fa3e40521ca2a05c01c8b0674c6ec5d7f9 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli <35596795+meysamhadeli@users.noreply.github.com> Date: Thu, 12 Jan 2023 00:13:27 +0330 Subject: [PATCH 1/3] Delete release-please.yml --- .github/workflows/release-please.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index bd31072..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,15 +0,0 @@ -# https://github.com/google-github-actions/release-please-action#how-release-please-works -# https://www.conventionalcommits.org/en/v1.0.0/ -on: - push: - branches: - - main -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - release-type: go - package-name: release-please-action From bb0ef6b9a3c2db6c468969e66e93e666d1e35360 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli <35596795+meysamhadeli@users.noreply.github.com> Date: Thu, 12 Jan 2023 00:14:52 +0330 Subject: [PATCH 2/3] Add files via upload --- .github/dependabot.yml | 14 +++++ .github/pull_request_template.md | 39 +++++++++++++ .github/release-drafter.yml | 99 ++++++++++++++++++++++++++++++++ .github/release.yml | 47 +++++++++++++++ 4 files changed, 199 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/release-drafter.yml create mode 100644 .github/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..96fe9c3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: nuget + directory: '/' + schedule: + interval: monthly + reviewers: + - meysamhadeli + assignees: + - meysamhadeli + ignore: + - dependency-name: '*' + versions: + - '>= 0' \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..0ff9814 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,39 @@ + + +## What does this PR do? + + + +## Why is it important? + + + +## Related issues + + +- + + + + \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..4b935df --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,99 @@ +# https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/ +# https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually +# https://github.com/release-drafter/release-drafter/issues/551 +# https://github.com/release-drafter/release-drafter/pull/1013 +# https://github.com/release-drafter/release-drafter/issues/139 +# https://github.com/atk4/data/blob/develop/.github/release-drafter.yml + +# This release drafter follows the conventions from https://keepachangelog.com, https://common-changelog.org/ +# https://www.conventionalcommits.org + +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + ## What Changed ๐Ÿ‘€ + + $CHANGES + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION +categories: + - title: ๐Ÿš€ Features + labels: + - feature + - title: ๐Ÿ› Bug Fixes + labels: + - fix + - bug + - title: โ™ป๏ธ Changes + labels: + - changed + - enhancement + - refactor + - title: โ›”๏ธ Deprecated + labels: + - deprecated + - title: ๐Ÿ—‘ Removed + labels: + - removed + - title: ๐Ÿ” Security + labels: + - security + - title: ๐Ÿ“„ Documentation + labels: + - docs + - documentation + - title: ๐Ÿงฉ Dependency Updates + labels: + - deps + - dependencies + - title: ๐Ÿงฐ Maintenance + label: 'chore' + - title: ๐Ÿงบ Miscellaneous #Everything except ABAP + label: misc + - title: ๐Ÿ“ Other changes +## putting no labels pr to `Other Changes` category with no label - https://github.com/release-drafter/release-drafter/issues/139#issuecomment-480473934 + +# https://www.trywilco.com/post/wilco-ci-cd-github-heroku +# https://github.com/release-drafter/release-drafter#autolabeler +# https://github.com/fuxingloh/multi-labeler + +# Using regex for defining rules - https://regexr.com/ - https://regex101.com/ +autolabeler: + - label: 'chore' + branch: + - '/(chore)\/.*/' + title: + - '/^chore: .*/' + - label: 'docs' + branch: + - '/(docs)\/.*/' + title: + - '/^docs: .*/' + - label: 'bug' + branch: + - '/(fix)\/.*/' + title: + - '/^fix: .*/' + - label: 'feature' + branch: + - '/(feat)\/.*/' + title: + - '/^feat: .*/' + body: + - '/JIRA-[0-9]{1,4}/' + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - major + minor: + labels: + - minor + patch: + labels: + - patch + default: patch + +exclude-labels: + - skip-changelog diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..b209cf1 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,47 @@ +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +# https://github.com/bcoe/conventional-release-labels +# https://dev.to/github/how-to-automatically-generate-release-notes-for-your-project-2ng8 +# https://www.conventionalcommits.org/en/v1.0.0/ + +# github release pre-defined template +changelog: + exclude: + labels: + - ignore-for-release + categories: + - title: ๐Ÿš€ Features + labels: + - feature + - title: ๐Ÿ› Bug Fixes + labels: + - fix + - bug + - title: โ™ป๏ธ Changes + labels: + - changed + - enhancement + - refactor + - title: โ›”๏ธ Deprecated + labels: + - deprecated + - title: ๐Ÿ—‘ Removed + labels: + - removed + - title: ๐Ÿ” Security + labels: + - security + - title: ๐Ÿ“„ Documentation + labels: + - docs + - documentation + - title: ๐Ÿงฉ Dependency Updates + labels: + - deps + - dependencies + - title: ๐Ÿงฐ Maintenance + label: 'chore' + - title: ๐Ÿงบ Miscellaneous #Everything except ABAP + label: misc + - title: Other Changes + labels: + - "*" From 662f30d8f60e955e45bcdc325139a15d84c8e5cf Mon Sep 17 00:00:00 2001 From: Meysam Hadeli <35596795+meysamhadeli@users.noreply.github.com> Date: Thu, 12 Jan 2023 00:15:49 +0330 Subject: [PATCH 3/3] Add files via upload --- .github/workflows/checker.yml | 33 ++++++++++++++++ .github/workflows/codeql-analysis.yml | 38 +++++++++++++++++++ .github/workflows/release-drafter-labeler.yml | 21 ++++++++++ .github/workflows/release-drafter.yml | 20 ++++++++++ .github/workflows/update-changelog.yml | 30 +++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 .github/workflows/checker.yml create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/release-drafter-labeler.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/update-changelog.yml diff --git a/.github/workflows/checker.yml b/.github/workflows/checker.yml new file mode 100644 index 0000000..9c6ed5a --- /dev/null +++ b/.github/workflows/checker.yml @@ -0,0 +1,33 @@ +# https://github.com/amannn/action-semantic-pull-request +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests + +name: Conventional Commits Checks + +on: + workflow_run: + workflows: ["Release Drafter Auto Labeler"] + types: + - completed + +#concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number }} +# cancel-in-progress: true + +jobs: + + check-conventional-commits-labels: + name: Check conventional commits labels + runs-on: [ self-hosted ] + steps: + - uses: danielchabr/pr-labels-checker@v3.1 + with: + hasSome: feature,fix,changed,deprecated,removed,security,docs,dependencies + githubToken: ${{ secrets.GITHUB_TOKEN }} + + validate-pull-request-title: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..5cf6245 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,38 @@ +name: CodeQL + +on: + push: + branches: [ develop, main ] + pull_request: + branches: [ develop, main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + analyze: + strategy: + fail-fast: false + matrix: + language: [ csharp ] + + permissions: + security-events: write + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/release-drafter-labeler.yml b/.github/workflows/release-drafter-labeler.yml new file mode 100644 index 0000000..dfae2e3 --- /dev/null +++ b/.github/workflows/release-drafter-labeler.yml @@ -0,0 +1,21 @@ +name: Release Drafter Auto Labeler + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + +jobs: + auto-labeler: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + disable-releaser: true # only run auto-labeler for PRs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..5e1d3dd --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,20 @@ + # https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/ + # https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually + name: Release Drafter + + on: + push: + branches: + - develop + - main + + jobs: + update_release_draft: + name: Release drafter + runs-on: ubuntu-latest + + steps: + - name: Update Release Draft + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 0000000..c82b5c8 --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,30 @@ + on: + release: + types: + - released + push: + branches: + - main + +# Every push to main will create a new release and deploy to production. + jobs: + update: + name: Update Changelog + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated Changelog + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: 'docs(changelog): update changelog' + file_pattern: CHANGELOG.md