-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
107 lines (101 loc) · 2.94 KB
/
.gitlab-ci.yml
File metadata and controls
107 lines (101 loc) · 2.94 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
image: mcr.microsoft.com/dotnet/sdk:9.0
stages:
- build-test
- check-and-create-release
- publish
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
NUKE_TELEMETRY_OPTOUT: "1" # Disable
IGNORE_NORMALISATION_GIT_HEAD_MOVE: "1"
# To overwrite them, just set them in the CI/CD settings
PUBLISH_SELF_CONTAINED: "true"
PUBLISH_SINGLE_FILE: "true"
PUBLISH_TRIMMED: "true"
.container_template:
services:
- docker:dind
before_script:
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends apt-transport-https ca-certificates curl gnupg
- apt-get install -yqq docker.io
# build the project on every commit
test:
extends:
- .container_template
stage: build-test
except:
- tags
- schedules
script:
- |
./build.sh Restore Compile TestReport Publish CreateContainer \
--configuration "Debug" \
--publish-directory "./publish"
- set +e; bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/coverage.xml
coverage: '/^ Line coverage: (\d*.\d*)%/'
artifacts:
paths:
- coverage/report/*
- publish/*
reports:
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml
# check if there is new commits, if so, create a tag and a release
# this will trigger the publishing stage "publish"
check-and-create-release:
stage: check-and-create-release
only:
- schedules
- web
script:
- |
./build.sh GitLabCreateRelease \
--is-scheduled $CI_PIPELINE_SCHEDULED \
--gitlab-private-token $GITLAB_PRIVATE_TOKEN
# publish the project on every tag
# build for multiple runtimes
publish:
extends:
- .container_template
stage: publish
only:
- tags
except:
- branches
script:
- |
./build.sh Restore Publish GitLabUploadPackage GitLabPushContainer \
--runtime-identifier $RID \
--publish-directory "./publish/SuCoS-$RID" \
--publish-self-contained $PUBLISH_SELF_CONTAINED \
--publish-single-file $PUBLISH_SINGLE_FILE \
--publish-trimmed $PUBLISH_TRIMMED \
--container-registry-image $CI_REGISTRY_IMAGE \
--gitlab-private-token $GITLAB_PRIVATE_TOKEN
parallel:
matrix:
- RID: "win-x64"
- RID: "linux-x64"
- RID: "linux-musl-x64"
# FIXME: publish the Debian package, temporarily as an separate step
# publish-debian:
# stage: publish
# only:
# - tags
# except:
# - branches
# script:
# - |
# ./build.sh Restore Publish GitLabPushDebianPackage \
# --runtime-identifier $RID \
# --publish-directory "./publish/SuCoS-$RID" \
# --publish-self-contained $PUBLISH_SELF_CONTAINED \
# --publish-single-file $PUBLISH_SINGLE_FILE \
# --publish-trimmed $PUBLISH_TRIMMED \
# --container-registry-image $CI_REGISTRY_IMAGE \
# --gitlab-private-token $GITLAB_PRIVATE_TOKEN
# parallel:
# matrix:
# - RID: "linux-x64"