forked from hyperlogic/splatapult
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
54 lines (40 loc) · 1.1 KB
/
tasks.py
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
from invoke import task
import os
import shutil
RELEASE_NAME = "splatapult-0.1-x64"
VCPKG_DIR = os.getenv("VCPKG_DIR")
@task
def clean(c):
c.run("rm -rf build")
@task
def build(c):
c.run("mkdir build")
with c.cd("build"):
c.run(
f'cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="{VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake" ..'
)
c.run(f"cmake --build . --config Release")
@task
def build_debug(c):
c.run("mkdir build")
with c.cd("build"):
c.run(
f'cmake -DSHIPPING=OFF -DCMAKE_TOOLCHAIN_FILE="{VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake" ..'
)
c.run(f"cmake --build . --config Debug")
@task
def archive(c):
shutil.make_archive(RELEASE_NAME, "zip", "build/Release")
@task
def deploy(c):
c.run(f"cp {RELEASE_NAME}.zip ../hyperlogic.github.io/files")
with c.cd("../hyperlogic.github.io"):
c.run(f"git add files/{RELEASE_NAME}.zip")
c.run(f'git commit -m "Automated deploy of {RELEASE_NAME}"')
c.run("git push")
@task
def all(c):
clean(c)
build(c)
archive(c)
deploy(c)