forked from Rudokhvist/BoosterCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
57 lines (50 loc) · 2.09 KB
/
build.bat
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
@echo off
rem getting current dir name by Tamara Wijsman, https://superuser.com/questions/160702
for %%I in (.) do set CurrDirName=%%~nxI
rem download submodule
if not exist ArchiSteamFarm\ArchiSteamFarm (git submodule update --init)
if [%1]==[] goto noarg
rem update submodule to required tag, if specified...
git submodule foreach "git fetch origin; git checkout %1;"
goto continue
:noarg
rem ...otherwise update submodule to latest tag
git submodule foreach "git fetch origin; git checkout $(git rev-list --tags --max-count=1);"
:continue
rem print what version we are building for
git submodule foreach "git describe --tags;"
rem wipe out old build
if exist out rmdir /Q /S out
rem release generic version
dotnet publish -c "Release" -f "net7.0" -o "out/generic" "/p:LinkDuringPublish=false"
mkdir .\out\%CurrDirName%
copy .\out\generic\%CurrDirName%.dll .\out\%CurrDirName%
rem comment section below (downto :zip label) if you don't want to include documentation
if not exist README.md (goto zip)
where /q pandoc.exe
if ERRORLEVEL 1 (
copy README.md .\out\%CurrDirName%
goto zip
) else (
pandoc --metadata title="%CurrDirName%" --standalone --columns 2000 -f markdown -t html --self-contained -c .\github-pandoc.css -o .\out\%CurrDirName%\README.html README.md
)
:zip
7z a -tzip -mx7 .\out\%CurrDirName%.zip .\out\%CurrDirName%
rmdir /Q /S out\%CurrDirName%
rem release generic-netf version
rem comment section below if you don't target netf ASF version
dotnet publish -c "Release" -f "net481" -o "out/generic-netf"
mkdir .\out\%CurrDirName%
copy .\out\generic-netf\%CurrDirName%.dll .\out\%CurrDirName%
rem comment section below (downto :zipnetf label) if you don't want to include documentation
if not exist README.md (goto zipnetf)
where /q pandoc.exe
if ERRORLEVEL 1 (
copy README.md .\out\%CurrDirName%
goto zipnetf
) else (
pandoc --metadata title="%CurrDirName%" --standalone --columns 2000 -f markdown -t html --self-contained -c .\github-pandoc.css -o .\out\%CurrDirName%\README.html README.md
)
:zipnetf
7z a -tzip -mx7 .\out\%CurrDirName%-netf.zip .\out\%CurrDirName%
rmdir /Q /S out\%CurrDirName%