build: updating release script

This commit is contained in:
Dylan R. E. Moonfire 2021-11-29 18:53:03 -06:00
parent 71c0d4a217
commit 1a95d460be
2 changed files with 25 additions and 22 deletions

View file

@ -1,5 +1,10 @@
include:
- template: Security/SAST.gitlab-ci.yml
stages:
- build
- test
- release
default:
before_script:
@ -13,30 +18,19 @@ build:
# Set up the environment.
- npx npm install --ci
- npx commitlint-gitlab-ci -x @commitlint/config-conventional
# Build and test everything.
- dotnet restore
- dotnet build
#- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"'
# Summarize the output for Gitlab CI reporting.
#- dotnet new tool-manifest
#- dotnet tool install dotnet-reportgenerator-globaltool
#- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
#- grep "Line coverage" coverage/Summary.txt
# Perform the release.
- npx semantic-release
rules:
- if: '$CI_COMMIT_TITLE =~ /^chore\(release\)/'
when: never
- if: '$CI_COMMIT_TAG'
when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- when: on_success
- if: $CI_COMMIT_BRANCH
test:
stage: test
script:
- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"'
- dotnet new tool-manifest
- dotnet tool install dotnet-reportgenerator-globaltool
- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
- grep "Line coverage" coverage/Summary.txt
artifacts:
when: always
paths:
@ -49,3 +43,12 @@ build:
- ./**/*test-result.xml
cobertura:
- ./coverage/Cobertura.xml
publish:
stage: release
script:
- npm install --ci
- npm run build
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

View file

@ -1,6 +1,6 @@
module.exports = {
branches: ["main"],
message: "chore(release): v${nextRelease.version}\n\n${nextRelease.notes}",
message: "chore(release): v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",