-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
125 lines (116 loc) · 2.74 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
stages:
- build
- test
- package
- publish
workflow:
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH !~ /^\d+-/
- if: $CI_COMMIT_TAG
variables:
NUGET_PROJECT_ID_DEV: 18697166
NUGET_PROJECT_ID_RELEASE: 21286970
.defaults:
rules:
- &is_master $CI_COMMIT_BRANCH == 'master'
- &is_release $CI_COMMIT_TAG =~ /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$/i
- ¬_release $CI_COMMIT_TAG !~ /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$/i
client_cache: &client_cache
key: client
paths:
- 'Client/node_modules/'
before_script: &before_script
- dotnet nuget add source --name sequence --username $NUGET_USERNAME
--password $NUGET_TOKEN --store-password-in-clear-text
"https://gitlab.com/api/v4/projects/$NUGET_PROJECT_ID/packages/nuget/index.json"
build server:
stage: build
image: mcr.microsoft.com/dotnet/sdk:6.0
variables:
NUGET_PROJECT_ID: $NUGET_PROJECT_ID_DEV
NUGET_USERNAME: $NUGET_USER_DEV
NUGET_TOKEN: $NUGET_TOKEN_DEV
before_script: *before_script
script:
- cd ./Server
- dotnet build -c Release
artifacts:
paths:
- 'Client/Server'
- 'Server/*/bin'
- 'Server/*/obj'
expire_in: 2 hours
test server:
stage: test
image: mcr.microsoft.com/dotnet/sdk:6.0
needs:
- build server
script:
- cd ./Server
- dotnet test --no-build -c Release
build client:
stage: build
image: node:latest
script:
- cd ./Client
- npm install
- npm run compile
artifacts:
paths:
- 'Client/out'
expire_in: 2 hours
cache: *client_cache
test client:
stage: test
image: node:latest
needs:
- build client
before_script:
- apt update
- apt install -y libasound2 libgbm-dev libgtk-3-0 libnss3 xvfb
script:
- cd ./Client
- xvfb-run -a npm run test
cache:
<<: *client_cache
policy: pull
package extension:
stage: package
image: node:latest
needs:
- build server
- test server
- build client
- test client
script:
- cd ./Client
- npm run package-ci
rules:
- if: *is_release
- if: *is_master
- if: *not_release
when: manual
allow_failure: true
cache:
<<: *client_cache
policy: pull
artifacts:
name: 'sequence-scl.vsix'
paths:
- 'Client/*.vsix'
expire_in: 3 months
publish extension:
stage: publish
image: node:latest
needs:
- package extension
script:
- cd ./Client
- npm run publish-ci
rules:
- if: *is_release
cache:
<<: *client_cache
policy: pull