-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
75 lines (71 loc) · 1.77 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
include:
## https://git.custis.ru/devops/include/default
- project: devops/include/default
file:
- dotnet.yml
- npm.yml
- git.yml
- version.yml
stages:
- pack
- publish
pack:
extends: .pack-dotnet-nuget
publish-nuget:
extends: .publish-dotnet-nuget
## Сборка и упаковка для nuget
.pack-dotnet-nuget:
stage: pack
image: ${DOTNET_SDK_IMAGE}
tags: [office-custis-ru]
allow_failure: false
variables:
DOTNET_STATE: "pack"
DOTNET_OUT: "${CI_PROJECT_DIR}/dotnet_out"
script:
- !reference [.get-version]
- !reference [.get-version-tag]
- !reference [.npm-add-config-nexus]
- !reference [.dotnet-add-nuget-config]
- !reference [.dotnet-project]
- !reference [.dotnet-project-version]
- !reference [.add-git-tag]
needs:
- job: test
optional: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^((fix|rel|release)(\/|-|_))(([0-9]+)(|\.[0-9]+)(|\.[0-9]+)(|\.[0-9]+))$/
when: on_success
variables:
COMMIT_TAGGING: "false"
- if: $CI_COMMIT_TAG
when: on_success
- if: $CI_COMMIT_REF_NAME =~ /^(master|main)$/ || $CI_COMMIT_REF_NAME == $GIT_MAIN_BRANCH
when: on_success
variables:
GET_VERSION_MAIN: "false"
- when: never
artifacts:
paths:
- ${DOTNET_OUT}/
expire_in: 1 day
## Публикация в nuget.org
.publish-dotnet-nuget:
stage: publish
image: ${DOTNET_SDK_IMAGE}
tags: [office-custis-ru]
retry: 1
variables:
NUGET_TARGET: "nuget"
NUGET_SKIP_DUPLICATE: "true"
script:
- !reference [.dotnet-project-nuget]
needs:
- job: pack
artifacts: true
rules:
- if: $CI_COMMIT_TAG
when: manual
- when: never