-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
164 lines (152 loc) · 4.13 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
variables:
GIT_SUBMODULE_STRATEGY: recursive
# Requires manually keeping up to date with package.json
TF_TFW_VERSION: 1.4.0
stages:
- build
- test
- package
- deploy
.Always_Build:
stage: build
when: always
timeout: 10m
.Always_Test:
stage: test
when: always
timeout: 10m
build::bundle:
extends: .Always_Build
tags:
- unity
- win10
script:
# Get the TF Tooling for web version
- set -Name TF_API_VERSION -Value "$((Select-String -Path ".\src\internal\Connection\ServiceTypes.ts" "API_VERSION. '(.*)'," | Select-Object * -First 1).Matches.Groups[1].Value)"
# Update Version.txt with latest information before packaging
- python ./Scripts/UpdateVersionFile.py --path ${CI_PROJECT_DIR}/Version.txt --swVer $TF_TFW_VERSION --apiVer $TF_API_VERSION --ref ${CI_COMMIT_SHORT_SHA} --branchName "$CI_COMMIT_REF_NAME"
- Get-Content ${CI_PROJECT_DIR}/Version.txt
# Build Tooling
- cd ${CI_PROJECT_DIR}
- npm i
- npm run build:bundle
# Clean last build
- cd ${CI_PROJECT_DIR}
- if (Test-Path -Path "./Tooling_Release") {
Remove-Item -LiteralPath ./Tooling_Release -Force -Recurse
Remove-Item -LiteralPath ./Tooling_Release -Force -Recurse
}
# Package Tooling
- mkdir ./Tooling_Release
- cp ${CI_PROJECT_DIR}/Version.txt ./Tooling_Release
- cp ${CI_PROJECT_DIR}/CHANGELOG.md ./Tooling_Release
- cp -R ${CI_PROJECT_DIR}/dist ./Tooling_Release
- cp -R ${CI_PROJECT_DIR}/Plugins ./Tooling_Release
- cp -R ${CI_PROJECT_DIR}/quick-start ./Tooling_Release
artifacts:
name: 'Tooling_for_Web_Build_${CI_COMMIT_SHORT_SHA}'
paths:
- ./Tooling_Release/*
expire_in: 2 weeks
when: always
build::docs:
extends: .Always_Build
tags:
- docker-windows
image: registry.ultrahaptics.com/ooh/infrastructure/windows-touchfree-toolchain:latest
script:
- cd ${CI_PROJECT_DIR}
- npm i
- npm run build:docs
artifacts:
name: 'TouchFree_Tooling_Documentation'
paths:
- ./docs/markdown
expire_in: 2 weeks
when: always
test:
extends: .Always_Test
tags:
- docker-windows
image: registry.ultrahaptics.com/ooh/infrastructure/windows-touchfree-toolchain:latest
script:
# Run unit tests
- cd ${CI_PROJECT_DIR}
- npm i
- npm run test
- npm run test:coverage
artifacts:
when: always
name: 'TestResults'
paths:
- ${CI_PROJECT_DIR}/junit.xml
- ${CI_PROJECT_DIR}/coverage/
reports:
junit: ${CI_PROJECT_DIR}/junit.xml
coverage_report:
coverage_format: cobertura
path: ${CI_PROJECT_DIR}/coverage/cobertura-coverage.xml
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
pages:
stage: deploy
dependencies:
- test
script:
- mkdir .public
- cp ${CI_PROJECT_DIR}/coverage/* .public
- mv .public public
artifacts:
paths:
- public
only:
- develop
package::bundle:
stage: package
image: alpine:3.13
dependencies:
- build::bundle
- build::docs
needs: ['build::bundle', 'build::docs']
script:
- mkdir ./Tooling_Package/
- cp -R ./Tooling_Release/* ./Tooling_Package/
- cp -R ./docs/markdown ./Tooling_Package/Documentation/
artifacts:
name: 'TouchFree_Tooling_for_Web_${TF_TFW_VERSION}_${CI_COMMIT_SHORT_SHA}'
paths:
- ./Tooling_Package/*
expire_in: 2 weeks
when: always
tags:
- docker
npm::publish:
stage: deploy
when: manual
tags:
- docker-windows
image: registry.ultrahaptics.com/ooh/infrastructure/windows-touchfree-toolchain:latest
only:
- release
script:
- npm config -L project set //registry.npmjs.org/:username=ul-touchfree
- npm config -L project set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- npm i
- npm run build:tsc
- npm publish
npm::pack:
stage: package
when: always
tags:
- docker-windows
image: registry.ultrahaptics.com/ooh/infrastructure/windows-touchfree-toolchain:latest
only:
- release
script:
- npm i
- npm run build:tsc
- npm pack
artifacts:
name: 'TouchFree_Tooling_npm_package_${TF_TFW_VERSION}_${CI_COMMIT_SHORT_SHA}'
paths:
- touchfree*.tgz
expire_in: 2 weeks