1+ @ echo off
12dotnet publish -c Release -p:PublishProfile=Profile_Contained_win-x86
23dotnet publish -c Release -p:PublishProfile=Profile_Contained_win-x64
34dotnet publish -c Release -p:PublishProfile=Profile_Contained_win-arm64
@@ -18,25 +19,65 @@ dotnet publish -c Release -p:PublishProfile=Profile_Dependent_linux-arm
1819dotnet publish -c Release -p:PublishProfile=Profile_Dependent_linux-arm64
1920dotnet publish -c Release -p:PublishProfile=Profile_Dependent_linux-musl-x64
2021
22+ SETLOCAL
23+
24+ SET " PROJECT_FILE = HashifyNETCLI.csproj"
25+ FOR /F " usebackq" %%i IN (`powershell -Command " ((Select-Xml -Path '%PROJECT_FILE% ' -XPath '//Version').Node.InnerText).Replace('.', '-')" `) DO (
26+ SET " PROJECT_VERSION = %%i "
27+ )
28+
2129cd " bin\Release\net8.0\publish\contained\"
22- tar -a -c -f " win-x86-contained.zip" " win-x86"
23- tar -a -c -f " win-x64-contained.zip" " win-x64"
24- tar -a -c -f " win-arm64-contained.zip" " win-arm64"
25- tar -a -c -f " osx-x64-contained.zip" " osx-x64"
26- tar -a -c -f " osx-arm64-contained.zip" " osx-arm64"
27- tar -a -c -f " linux-x64-contained.zip" " linux-x64"
28- tar -a -c -f " linux-arm-contained.zip" " linux-arm"
29- tar -a -c -f " linux-arm64-contained.zip" " linux-arm64"
30- tar -a -c -f " linux-musl-x64-contained.zip" " linux-musl-x64"
30+
31+ echo Archiving...
32+
33+ IF DEFINED PROJECT_VERSION (
34+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-x86-contained.zip" " win-x86"
35+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-x64-contained.zip" " win-x64"
36+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-arm64-contained.zip" " win-arm64"
37+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -osx-x64-contained.zip" " osx-x64"
38+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -osx-arm64-contained.zip" " osx-arm64"
39+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-x64-contained.zip" " linux-x64"
40+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-arm-contained.zip" " linux-arm"
41+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-arm64-contained.zip" " linux-arm64"
42+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-musl-x64-contained.zip" " linux-musl-x64"
43+ ) ELSE (
44+ tar -a -c -f " hashifycli-win-x86-contained.zip" " win-x86"
45+ tar -a -c -f " hashifycli-win-x64-contained.zip" " win-x64"
46+ tar -a -c -f " hashifycli-win-arm64-contained.zip" " win-arm64"
47+ tar -a -c -f " hashifycli-osx-x64-contained.zip" " osx-x64"
48+ tar -a -c -f " hashifycli-osx-arm64-contained.zip" " osx-arm64"
49+ tar -a -c -f " hashifycli-linux-x64-contained.zip" " linux-x64"
50+ tar -a -c -f " hashifycli-linux-arm-contained.zip" " linux-arm"
51+ tar -a -c -f " hashifycli-linux-arm64-contained.zip" " linux-arm64"
52+ tar -a -c -f " hashifycli-linux-musl-x64-contained.zip" " linux-musl-x64"
53+ )
54+
3155cd " ..\dependent\"
32- tar -a -c -f " win-x86-dependent.zip" " win-x86"
33- tar -a -c -f " win-x64-dependent.zip" " win-x64"
34- tar -a -c -f " win-arm64-dependent.zip" " win-arm64"
35- tar -a -c -f " osx-x64-dependent.zip" " osx-x64"
36- tar -a -c -f " osx-arm64-dependent.zip" " osx-arm64"
37- tar -a -c -f " linux-x64-dependent.zip" " linux-x64"
38- tar -a -c -f " linux-arm-dependent.zip" " linux-arm"
39- tar -a -c -f " linux-arm64-dependent.zip" " linux-arm64"
40- tar -a -c -f " linux-musl-x64-dependent.zip" " linux-musl-x64"
56+
57+ IF DEFINED PROJECT_VERSION (
58+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-x86-dependent.zip" " win-x86"
59+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-x64-dependent.zip" " win-x64"
60+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -win-arm64-dependent.zip" " win-arm64"
61+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -osx-x64-dependent.zip" " osx-x64"
62+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -osx-arm64-dependent.zip" " osx-arm64"
63+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-x64-dependent.zip" " linux-x64"
64+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-arm-dependent.zip" " linux-arm"
65+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-arm64-dependent.zip" " linux-arm64"
66+ tar -a -c -f " hashifycli-%PROJECT_VERSION% -linux-musl-x64-dependent.zip" " linux-musl-x64"
67+ ) ELSE (
68+ tar -a -c -f " hashifycli-win-x86-dependent.zip" " win-x86"
69+ tar -a -c -f " hashifycli-win-x64-dependent.zip" " win-x64"
70+ tar -a -c -f " hashifycli-win-arm64-dependent.zip" " win-arm64"
71+ tar -a -c -f " hashifycli-osx-x64-dependent.zip" " osx-x64"
72+ tar -a -c -f " hashifycli-osx-arm64-dependent.zip" " osx-arm64"
73+ tar -a -c -f " hashifycli-linux-x64-dependent.zip" " linux-x64"
74+ tar -a -c -f " hashifycli-linux-arm-dependent.zip" " linux-arm"
75+ tar -a -c -f " hashifycli-linux-arm64-dependent.zip" " linux-arm64"
76+ tar -a -c -f " hashifycli-linux-musl-x64-dependent.zip" " linux-musl-x64"
77+ )
78+
79+ ENDLOCAL
80+
81+ echo Completed!
4182
4283@ pause
0 commit comments