-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
132 lines (127 loc) · 4.73 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
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
stages:
- test
- generate_engine
- generate_editor
- release
run_tests:
stage: test
image: "python:3.7.9"
only:
refs:
- merge_requests
before_script:
- python --version
- pip install -r requirements_editor.txt
script:
- echo "Running tests"
- python -m app.engine.component_system_compiler.source_generator
- python -m unittest discover -s app/tests -p 'test*.py'
build_engine:
stage: generate_engine
image: "python:3.7.9"
extends:
- .shared_windows_runners
except: # If this double builds consider changing to only: pushes
refs:
- merge_requests
only:
- release
before_script:
- choco install -y python --version=3.7.9
- "C:\\Python37\\python.exe -m pip install -r requirements_engine.txt"
- "C:\\Python37\\python.exe -m pip install pywin32"
- "C:\\Python37\\python.exe -m pip install setuptools --upgrade"
- echo "Prereqs successfully installed"
script:
- echo "Generating component files"
- "C:\\Python37\\python.exe -m app.engine.component_system_compiler.source_generator"
- start powershell
- echo "Building generic engine..."
- cp ./utilities/build_tools/generic_engine.spec .
- "C:\\Python37\\Scripts\\pyinstaller.exe -y generic_engine.spec"
- rm generic_engine.spec -fo
- mkdir lt_engine
- mv dist/lt_engine ./lt_engine/lt_engine
- cp utilities/install/double_click_to_play.bat ./lt_engine
- echo "Copying generated files"
- cp app/engine/item_system.py ./lt_engine/lt_engine/app/engine
- cp app/engine/skill_system.py ./lt_engine/lt_engine/app/engine
- echo $CI_COMMIT_SHORT_SHA > ./lt_engine/lt_engine/version.txt
- echo "Done!"
artifacts:
name: "LT Engine"
paths:
- lt_engine/
build_editor:
stage: generate_editor
image: "python:3.7.9"
extends:
- .shared_windows_runners
except: # If this double builds consider changing to only: pushes
refs:
- merge_requests
only:
- release
before_script:
- choco install -y python --version=3.7.9
- "C:\\Python37\\python.exe -m pip install -r requirements_editor.txt"
- "C:\\Python37\\python.exe -m pip install pywin32"
- "C:\\Python37\\python.exe -m pip install setuptools --upgrade"
- echo "Prereqs successfully installed"
script:
- echo "Generating component files"
- "C:\\Python37\\python.exe -m app.engine.component_system_compiler.source_generator"
- start powershell
- echo "Now building main editor..."
- cp ./utilities/build_tools/editor.spec .
- "C:\\Python37\\Scripts\\pyinstaller.exe -y editor.spec"
- rm editor.spec -fo
- mkdir lt_editor
- mv dist/lt_editor ./lt_editor/lt_editor
- cp utilities/install/double_click_to_run.bat ./lt_editor
- mv build/editor ./lt_editor/lt_editor
- echo "Copying default lt project..."
- cp default.ltproj ./lt_editor/lt_editor -r
- echo "Copying generated files"
- cp app/engine/item_system.py ./lt_editor/lt_editor/app/engine
- cp app/engine/skill_system.py ./lt_editor/lt_editor/app/engine
- echo $CI_COMMIT_SHORT_SHA > ./lt_editor/lt_editor/version.txt
- echo "Done!"
artifacts:
name: "LT Editor"
paths:
- lt_editor/
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: build_editor
artifacts: true
- job: build_engine
except:
refs:
- merge_requests
only:
- release
script:
- echo 'running release'
- echo 'remember to make sure your url is correct!'
release:
name: 'Release Executables $CI_COMMIT_SHORT_SHA'
description: 'Download Lex_Talionis_Maker from the Packages header to use the editor! Once the download is extracted run double_click_to_run.bat to open the editor.'
tag_name: '$CI_COMMIT_SHORT_SHA'
assets:
links: # IF SOMETHING IS BROKEN, IT'S PROBABLY THESE URLS FAULT
- name: 'Lex_Talionis_Maker'
filepath: /lex_talionis_maker
url: "https://gitlab.com/rainlash/lt-maker/-/jobs/artifacts/release/download?job=build_editor"
link_type: package
- name: 'Lex_Talionis_Engine'
filepath: /lex_talionis_engine
url: "https://gitlab.com/rainlash/lt-maker/-/jobs/artifacts/release/download?job=build_engine"
link_type: package