-
Notifications
You must be signed in to change notification settings - Fork 11
/
release.py
36 lines (28 loc) · 1.45 KB
/
release.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
# Sets up upm branch with a Unity importable version of the Sylves source
# Requires, subdir upm set up as a git clone, checked out to branch upm
import os
import shutil
import re
import subprocess
import zipfile
# Pre-process Unity.Godot
subprocess.check_call(["dotnet","run","--project", "Sylves.GodotRewriter.csproj"], cwd="src/Sylves.GodotRewriter")
# Build solution
subprocess.check_call(["dotnet","build","src/Sylves.sln","-c","Release"])
subprocess.check_call(["dotnet","build","src/Sylves.sln","-c","UnityRelease"])
subprocess.check_call(["dotnet","build","src/Sylves.sln","-c","GodotRelease"])
# Build docs
subprocess.check_call(["docfx","docs/docfx.json"])
# Build zips
with zipfile.ZipFile('release/netstandard2.0.zip', 'w') as z:
z.write("src/Sylves/bin/Release/netstandard2.0/Sylves.dll", "Sylves.dll")
z.write("src/Sylves/bin/Release/netstandard2.0/Sylves.xml", "Sylves.xml")
z.write("LICENSE.txt", "LICENSE.txt")
with zipfile.ZipFile('release/Unity.zip', 'w') as z:
z.write("src/Sylves/bin/UnityRelease/netstandard2.0/Sylves.dll", "Sylves.dll")
z.write("src/Sylves/bin/UnityRelease/netstandard2.0/Sylves.xml", "Sylves.xml")
z.write("LICENSE.txt", "LICENSE.txt")
with zipfile.ZipFile('release/Godot.zip', 'w') as z:
z.write("src/Sylves.Godot/bin/Release/net6.0/Sylves.Godot.dll", "Sylves.Godot.dll")
z.write("src/Sylves.Godot/bin/Release/net6.0/Sylves.Godot.xml", "Sylves.Godot.xml")
z.write("LICENSE.txt", "LICENSE.txt")