-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublish.py
43 lines (27 loc) · 847 Bytes
/
publish.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
from __future__ import print_function
from pathlib import Path
import os, shutil
LOCAL_FEED = Path(r".\dev\localnuget").absolute()
if not LOCAL_FEED.exists():
os.makedirs(LOCAL_FEED)
projects = ["FastExpressionKit", "FastExpressionKit.BulkInsert"]
version = "1.5.0"
def c(s):
print(">", s)
err = os.system(s)
assert not err
def nuke(pth):
if os.path.isdir(pth):
shutil.rmtree(pth)
def nuget_add(pth):
c(f"dotnet nuget push -s {LOCAL_FEED} {pth}")
startdir = Path(".").absolute()
for prjdir in projects:
os.chdir(startdir / prjdir)
nuke("bin")
nuke("obj")
def pack():
c(f"dotnet pack -c Release /p:Version={version} /p:PubVer={version}")
pkgs = list(Path("bin/Release").glob("*.nupkg"))
nuget_add(pkgs[0])
pack()