generated from JustArchiNET/ASF-PluginTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
38 lines (33 loc) · 1.42 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
@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" -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%" -V title="" --standalone --columns 2000 -f gfm -t html --embed-resources -c https://raw.githubusercontent.com/CatPoweredPlugins/github.css/refs/heads/main/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%