This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
115 lines (100 loc) · 2.37 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
stages:
- prepare
- build_and_test
- deploy
variables:
BUILD_NAME: CrossyVosges
UNITY_ACTIVATION_FILE: ./unity3d.alf
IMAGE: unityci/editor
IMAGE_VERSION: 3
UNITY_DIR: $CI_PROJECT_DIR/Game
VERSION_NUMBER_VAR: $CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID-$CI_JOB_ID
VERSION_BUILD_VAR: $CI_PIPELINE_IID
image: $IMAGE:$UNITY_VERSION-base-$IMAGE_VERSION
get-unity-version:
image: alpine
stage: prepare
variables:
GIT_DEPTH: 1
script:
- echo UNITY_VERSION=$(cat $UNITY_DIR/ProjectSettings/ProjectVersion.txt | grep "m_EditorVersion:.*" | awk '{ print $2}') | tee prepare.env
artifacts:
reports:
dotenv: prepare.env
.unity_before_script: &unity_before_script
before_script:
- chmod +x ./ci/before_script.sh && ./ci/before_script.sh
needs:
- job: get-unity-version
artifacts: true
.cache: &cache
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG-$TEST_PLATFORM"
paths:
- $UNITY_DIR/Library/
.license: &license
rules:
- if: '$UNITY_LICENSE != null'
when: always
.unity_defaults: &unity_defaults
<<:
- *unity_before_script
- *cache
- *license
get-activation-file:
<<: *unity_before_script
rules:
- if: '$UNITY_LICENSE == null'
when: manual
stage: prepare
script:
- chmod +x ./ci/get_activation_file.sh && ./ci/get_activation_file.sh
artifacts:
paths:
- $UNITY_ACTIVATION_FILE
expire_in: 10 min
.build: &build
stage: build_and_test
<<: *unity_defaults
script:
- chmod +x ./ci/build.sh && ./ci/build.sh
artifacts:
paths:
- $UNITY_DIR/Builds/
tags:
- gitlab-org
build-android:
<<: *build
image: $IMAGE:$UNITY_VERSION-android-$IMAGE_VERSION
variables:
BUILD_TARGET: Android
BUILD_APP_BUNDLE: "false"
build-StandaloneLinux64:
<<: *build
variables:
BUILD_TARGET: StandaloneLinux64
build-StandaloneOSX:
<<: *build
image: $IMAGE:$UNITY_VERSION-mac-mono-$IMAGE_VERSION
variables:
BUILD_TARGET: StandaloneOSX
build-StandaloneWindows64:
<<: *build
image: $IMAGE:$UNITY_VERSION-windows-mono-$IMAGE_VERSION
variables:
BUILD_TARGET: StandaloneWindows64
pages:
image: alpine:latest
stage: deploy
script:
- mv "$UNITY_DIR/Builds/WebGL/${BUILD_NAME}" public
artifacts:
paths:
- public
only:
- main
workflow:
rules:
- if: $CI_COMMIT_TAG
when: always
- when: never