-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
69 lines (63 loc) · 1.58 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
stages:
- test
- version
- package
- deploy
# look if on release branch. Then calculate version based on tag and
create-version:
stage: version
image: registry.git.unyt.org/unyt/sdk/semver-tool
artifacts:
reports:
dotenv: version.env
paths:
- version
variables:
GITLAB_HOST: "https://git.unyt.org"
GITLAB_API_TOKEN: ${API_TOKEN}
script:
- semver
- export VERSION=$(cat version)
- echo "CREATE_VERSION=true" >> version.env
- echo $VERSION
only:
- /^feature.*$/
- /^release.*$/
.test:
stage: test
image: denoland/deno
allow_failure: true
timeout: 10m
script:
- deno run --allow-all --importmap importmap.json https://cdn.unyt.org/unyt_tests/run.ts --color=simple --reportfile=junit.xml ./test/
artifacts:
when: always
paths:
- junit.xml
reports:
junit:
- junit.xml
package:
stage: package
image: registry.git.unyt.org/unyt/sdk/utilities
needs:
- create-version
dependencies:
- create-version
before_script:
- '[ -f ./version ] && export VERSION=$(cat ./version)'
script:
- tar -czf /tmp/package.tar.gz ./
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file /tmp/package.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/unyt_core/${VERSION}/package.tar.gz"'
only:
- /^release.*$/
trigger:
stage: deploy
image: registry.git.unyt.org/unyt/sdk/utilities
dependencies:
- create-version
only:
- /^release.*$/
script:
- if [ "$CREATE_VERSION" != "true" ]; then return 1; fi
- curl https://cdn.unyt.org/update