Skip to content

Commit

Permalink
ci: 🎡 changes in the ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdihadeli committed Jan 18, 2023
1 parent 3e27dd8 commit 659bb1e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 140 deletions.
33 changes: 33 additions & 0 deletions .github/multi-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://github.com/fuxingloh/multi-labeler
version: v1

labels:
- label: "feat"
matcher:
title: "^feat: .*"
commits: "^feat: .*"
branch: "^feat/.*"

- label: "fix"
matcher:
title: "^fix: .*"
commits: "^fix: .*"
branch: "^fix/.*"

- label: "chore"
matcher:
title: "^chore: .*"
commits: "^chore: .*"
branch: "^chore/.*"

- label: "docs"
matcher:
title: "^docs: .*"
commits: "^docs: .*"
branch: "^docs/.*"

- label: "ci"
matcher:
title: "^ci: .*"
commits: "^ci: .*"
branch: "^ci/.*"
113 changes: 0 additions & 113 deletions .github/release-drafter.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
continue-on-error: false
if: steps.generate-report.outcome == 'success'
with:
name: test-results
name: build-test-artifacts
retention-days: 5
path: |
${{ github.workspace }}/output/CoverageResults/test-results.zip
Expand Down Expand Up @@ -220,6 +220,7 @@ jobs:
path: ~/.nuget/packages

# https://github.com/actions/download-artifact#download-all-artifacts
# download artifacts without name will download all artifacts
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -228,7 +229,7 @@ jobs:
- name: unzip artifacts
run: |
mkdir ${{ github.workspace }}/output
unzip {{ github.workspace }}/artifacts/test-results.zip -d ${{ github.workspace }}/output
unzip {{ github.workspace }}/artifacts/build-test-artifacts/test-results.zip -d ${{ github.workspace }}/output
# merging all coverage in a single coverage file and generating html files for downloading as artifacts
- name: Publish coverage report to coveralls.io
Expand Down Expand Up @@ -284,7 +285,7 @@ jobs:
zip -r publish-services.zip ./*
- name: Upload Publish Services Artifacts For Deployment Jobs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: (steps.publish-services.outcome == 'success' && ${{ inputs.publish_build_artifact }})
with:
name: publish-services
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,24 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

release-drafter-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 }}
jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@v1
with:
github-token: ${{secrets.GITHUB_TOKEN}} # optional, default to '${{ github.token }}'
config-path: .github/multi-labeler.yml # optional, default to '.github/labeler.yml'

# https://docs.github.com/en/actions/using-workflows/about-workflows#creating-dependent-jobs
# https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
check-conventional-commits-labels:
name: Check conventional commits labels
runs-on: ubuntu-latest
needs: release-drafter-auto-labeler
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
# https://docs.github.com/en/actions/using-workflows/about-workflows#creating-dependent-jobs
# https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
- name: check-conventional-commits-labels
uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of : feature,bug,enhancement,deprecated,removed,security,docs,dependencies,ci,chore
githubToken: ${{ secrets.GITHUB_TOKEN }}

validate-pull-request-title:
name: Validate PR title
runs-on: ubuntu-latest
needs: release-drafter-auto-labeler
steps:
- uses: amannn/action-semantic-pull-request@v5
- name: check-conventional-commits-labels
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ plugins:
- assets:
- path: release/**
- path: artifacts/test-results.zip
label: test-results
# The comment to add to each issue and pull request resolved by the release. Set to false to disable commenting on issues and pull requests
successComment: false
# The content of the issue created when a release fails. Set to false to disable opening an issue when a release fails
Expand Down
2 changes: 1 addition & 1 deletion ecommerce.sln
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{D87BDBDB-89BA-4703-B11D-E79A0935A909}"
ProjectSection(SolutionItems) = preProject
.github\release.yml = .github\release.yml
.github\release-drafter.yml = .github\release-drafter.yml
.github\dependabot.yml = .github\dependabot.yml
.github\pull_request_template.md = .github\pull_request_template.md
.github\multi-labeler.yml = .github\multi-labeler.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3CC5AECD-915C-4CCB-90AA-EF29EBD9A3E5}"
Expand Down

0 comments on commit 659bb1e

Please sign in to comment.