-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
52 lines (47 loc) · 1.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
default:
tags: [saas-linux-small-amd64]
image: mcr.microsoft.com/dotnet/sdk:8.0
stages:
- build
- test
- publish
build:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- pwsh -c "Install-PSResource -RequiredResourceFile './RequiredModules.psd1' -TrustRepository"
- pwsh -c "Invoke-Build -Task 'Build'"
artifacts:
untracked: true
test:
stage: test
dependencies:
- build
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- pwsh -c "Install-PSResource -RequiredResourceFile './RequiredModules.psd1' -TrustRepository"
- pwsh -c "Invoke-Build -Task 'Test'"
artifacts:
reports:
junit: testResults.xml
coverage: /Covered (\d+\.\d+%)/
publish:
stage: publish
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TITLE =~ /^\d+\.\d+\.\d+$/
script:
- pwsh -c "Install-PSResource -RequiredResourceFile './RequiredModules.psd1' -TrustRepository"
- pwsh -c "Invoke-Build -Task 'Publish' -ModuleVersion '$CI_COMMIT_TITLE' -ApiKey '$ApiKey'"
release:
stage: publish
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TITLE =~ /^\d+\.\d+\.\d+$/
script:
- echo "running release"
release:
tag_name: $CI_COMMIT_TITLE
description: $CI_COMMIT_TITLE
ref: $CI_COMMIT_SHA