-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitlab-ci.yml
174 lines (159 loc) · 5.49 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
165
166
167
168
169
170
171
172
173
174
include: VersionInfo.yml
stages:
- build
- pack
- deploy
variables:
REVISION_NUMBER: ${RELEASE_NUMBER}_${CI_COMMIT_SHORT_SHA}
EXPORT_NAME_RELEASE: ${GAME_NAME}_${RELEASE_NUMBER}
EXPORT_NAME_INTERNAL: ${GAME_NAME}_${RELEASE_NUMBER}_${CI_COMMIT_SHORT_SHA}
GIT_SUBMODULE_STRATEGY: recursive
# ================================================================================================================
# Job Dependencies
# ================================================================================================================
# =+=+=+=+=+=+=+= BUILD COMMON =+=+=+=+=+=+=+=
.build-internal: &build-internal
image: sdggames/godot-ci:$GODOT_VERSION
script:
- mkdir -v -p build/$BUILD_FOLDER
- mkdir -v -p .godot/editor
- mkdir -v -p .godot/imported
- echo godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/$EXPORT_NAME_INTERNAL$BUILD_FILE_EXTENSION
- godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/$EXPORT_NAME_INTERNAL$BUILD_FILE_EXTENSION
artifacts:
name: $EXPORT_NAME_INTERNAL
paths:
- build/
expire_in: 6 hour # We have a consolidated copy created in the final stage, just keep this while the pipeline might be running.
.build-release: &build-release
image: sdggames/godot-ci:$GODOT_VERSION
script:
- mkdir -v -p build/$BUILD_FOLDER
- mkdir -v -p .godot/editor
- mkdir -v -p .godot/imported
- echo godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/$EXPORT_NAME_RELEASE$BUILD_FILE_EXTENSION
- godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/$EXPORT_NAME_RELEASE$BUILD_FILE_EXTENSION
artifacts:
name: $EXPORT_NAME_RELEASE
paths:
- build/
expire_in: 6 hour # We have a consolidated copy created in the final stage, just keep this while the pipeline might be running.
.build-web: &build-web
image: sdggames/godot-ci:$GODOT_VERSION
script:
- mkdir -v -p build/$BUILD_FOLDER
- mkdir -v -p .godot/editor
- mkdir -v -p .godot/imported
- echo godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/index.html
- godot -v --headless $EXPORT_MODE "$BUILD_TARGET" build/$BUILD_FOLDER/index.html
artifacts:
name: $EXPORT_NAME_RELEASE
paths:
- build/
expire_in: 6 hour # We have a consolidated copy created in the final stage, just keep this while the pipeline might be running.
# ================================================================================================================
# Jobs
# ================================================================================================================
# =+=+=+=+=+=+=+= BUILD JOBS - DEBUG =+=+=+=+=+=+=+=
build_internal:windows-debug:
stage: build
variables:
BUILD_FILE_EXTENSION: .exe
BUILD_TARGET: "Windows"
BUILD_FOLDER: "windows-debug"
EXPORT_MODE: "--export-debug"
<<: *build-internal
except:
- main
build_internal:mac-debug:
stage: build
variables:
BUILD_FILE_EXTENSION: .zip
BUILD_TARGET: "macOS"
BUILD_FOLDER: "mac-debug"
EXPORT_MODE: "--export-debug"
<<: *build-internal
except:
- main
build_internal:linux-debug:
stage: build
variables:
BUILD_FILE_EXTENSION: .x86_64
BUILD_TARGET: "Linux"
BUILD_FOLDER: "linux-debug"
EXPORT_MODE: "--export-debug"
<<: *build-internal
except:
- main
build_internal:web-debug:
stage: build
variables:
BUILD_FILE_EXTENSION: index.html
BUILD_TARGET: "Web"
BUILD_FOLDER: "web-debug"
EXPORT_MODE: "--export-debug"
<<: *build-web
except:
- main
# =+=+=+=+=+=+=+= BUILD JOBS - RELEASE =+=+=+=+=+=+=+=
build_release:windows-release:
stage: build
variables:
BUILD_FILE_EXTENSION: .exe
BUILD_TARGET: "Windows"
BUILD_FOLDER: "windows-release"
EXPORT_MODE: "--export-release"
<<: *build-release
build_release:mac-release:
stage: build
variables:
BUILD_FILE_EXTENSION: .zip
BUILD_TARGET: "macOS"
BUILD_FOLDER: "mac-release"
EXPORT_MODE: "--export-release"
<<: *build-release
build_release:linux-release:
stage: build
variables:
BUILD_FILE_EXTENSION: .x86_64
BUILD_TARGET: "Linux"
BUILD_FOLDER: "linux-release"
EXPORT_MODE: "--export-release"
<<: *build-release
build_release:web-release:
stage: build
variables:
BUILD_FILE_EXTENSION: index.html
BUILD_TARGET: "Web"
BUILD_FOLDER: "web-release"
EXPORT_MODE: "--export-release"
<<: *build-web
# =+=+=+=+=+=+=+= PACK JOBS =+=+=+=+=+=+=+=
# Contain all of the builds in a single artifact so we don't have to download all the things!
consolidateArtifacts:
image: alpine:latest
stage: pack
script: "ls ./build"
artifacts:
name: $GAME_NAME_$REVISION_NUMBER
expose_as: "Build Output"
paths:
- ./build/
expire_in: 1 day # This is huge, we probably want to save it to a repo somewhere so we don't run out of space.
# =+=+=+=+=+=+=+= DEPLOY JOBS =+=+=+=+=+=+=+=
itchio-deploy:
image: sdggames/godot-ci:$GODOT_VERSION
stage: deploy
script:
- butler push ./build/linux-release $GROUP_NAME/$GAME_NAME:linux
- butler push ./build/windows-release $GROUP_NAME/$GAME_NAME:windows
- butler push ./build/mac-release $GROUP_NAME/$GAME_NAME:mac
- butler push ./build/web-release $GROUP_NAME/$GAME_NAME:web
needs:
- build_release:linux-release
- build_release:windows-release
- build_release:mac-release
- build_release:web-release
only:
- main
when: manual