Skip to content

Commit 1f4b2c9

Browse files
tgui autobuild is now build validation. adds initial gitlab ci support (#50547)
* tgui autobuild is now build validation. adds initial gitlab ci support * Remove autobuild github action Co-authored-by: Aleksej Komarov <[email protected]>
1 parent 5f403bb commit 1f4b2c9

File tree

3 files changed

+25
-38
lines changed

3 files changed

+25
-38
lines changed

.github/workflows/autobuild_tgui.yml

-38
This file was deleted.

.gitlab-ci.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build:
2+
stage: build
3+
rules:
4+
- if: $CI_MERGE_REQUEST_IID || $CI_COMMIT_REF_NAME == "master"
5+
changes:
6+
- tgui/**/*.js
7+
- tgui/**/*.scss
8+
when: always
9+
image: node:lts
10+
script:
11+
- tgui/bin/tgui --ci

tgui/bin/tgui

+14
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ task-clean() {
6262
rm -f **/package-lock.json
6363
}
6464

65+
## Validates current build against the build stored in git
66+
task-validate-build() {
67+
cd "${base_dir}"
68+
local diff
69+
diff="$(git diff packages/tgui/public/tgui.bundle.*)"
70+
if [[ -n ${diff} ]]; then
71+
echo "Error: our build differs from the build committed into git."
72+
echo "Please rebuild tgui."
73+
exit 1
74+
fi
75+
echo "tgui: build is ok"
76+
}
77+
6578
## Installs merge drivers and git hooks
6679
task-install-git-hooks() {
6780
cd "${base_dir}"
@@ -110,6 +123,7 @@ if [[ ${1} == "--ci" ]]; then
110123
task-install
111124
task-eslint
112125
task-webpack --mode=production
126+
task-validate-build
113127
exit 0
114128
fi
115129

0 commit comments

Comments
 (0)