-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.cmd
More file actions
142 lines (123 loc) · 5.47 KB
/
publish.cmd
File metadata and controls
142 lines (123 loc) · 5.47 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@echo off
setlocal enabledelayedexpansion
REM Get version from AzTagger.App.csproj
for /f "tokens=2 delims=<>" %%a in ('findstr /i "<Version>" AzTagger.App\AzTagger.App.csproj') do (
set FULL_VERSION=%%a
)
REM Extract major.minor.patch (remove the last .0)
for /f "tokens=1-3 delims=." %%a in ("!FULL_VERSION!") do (
set VERSION=%%a.%%b.%%c
)
echo Building and packaging AzTagger v%VERSION% for all platforms...
REM Clean publish directory
if exist publish\win-x64 rmdir /s /q publish\win-x64
if exist publish\win-arm64 rmdir /s /q publish\win-arm64
if exist publish\mac-x64 rmdir /s /q publish\mac-x64
if exist publish\mac-arm64 rmdir /s /q publish\mac-arm64
if exist publish\linux-x64 rmdir /s /q publish\linux-x64
if exist publish\linux-arm64 rmdir /s /q publish\linux-arm64
REM Build for Windows x64
echo.
echo Building for win-x64...
dotnet publish AzTagger.Wpf/AzTagger.Wpf.csproj -c Release -f net10.0-windows -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/win-x64
if errorlevel 1 (
echo ERROR: Failed to build for win-x64
exit /b 1
)
REM Build for Windows ARM64
echo.
echo Building for win-arm64...
dotnet publish AzTagger.Wpf/AzTagger.Wpf.csproj -c Release -f net10.0-windows -r win-arm64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/win-arm64
if errorlevel 1 (
echo ERROR: Failed to build for win-arm64
exit /b 1
)
REM Build for macOS x64
echo.
echo Building for mac-x64...
dotnet publish AzTagger.Mac/AzTagger.Mac.csproj -c Release -f net10.0 -r osx-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/mac-x64
if errorlevel 1 (
echo ERROR: Failed to build for mac-x64
exit /b 1
)
REM Build for macOS ARM64
echo.
echo Building for mac-arm64...
dotnet publish AzTagger.Mac/AzTagger.Mac.csproj -c Release -f net10.0 -r osx-arm64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/mac-arm64
if errorlevel 1 (
echo ERROR: Failed to build for mac-arm64
exit /b 1
)
REM Build for Linux x64
echo.
echo Building for linux-x64...
dotnet publish AzTagger.Gtk/AzTagger.Gtk.csproj -c Release -f net10.0 -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/linux-x64
if errorlevel 1 (
echo ERROR: Failed to build for linux-x64
exit /b 1
)
REM Build for Linux ARM64
echo.
echo Building for linux-arm64...
dotnet publish AzTagger.Gtk/AzTagger.Gtk.csproj -c Release -f net10.0 -r linux-arm64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish/linux-arm64
if errorlevel 1 (
echo ERROR: Failed to build for linux-arm64
exit /b 1
)
REM Create ZIP files
echo.
echo Creating ZIP files...
REM Remove old ZIP files if they exist
if exist "publish\AzTagger-v%VERSION%-win-x64.zip" del "publish\AzTagger-v%VERSION%-win-x64.zip"
if exist "publish\AzTagger-v%VERSION%-win-arm64.zip" del "publish\AzTagger-v%VERSION%-win-arm64.zip"
if exist "publish\AzTagger-v%VERSION%-mac-x64.zip" del "publish\AzTagger-v%VERSION%-mac-x64.zip"
if exist "publish\AzTagger-v%VERSION%-mac-arm64.zip" del "publish\AzTagger-v%VERSION%-mac-arm64.zip"
if exist "publish\AzTagger-v%VERSION%-linux-gtk-x64.zip" del "publish\AzTagger-v%VERSION%-linux-gtk-x64.zip"
if exist "publish\AzTagger-v%VERSION%-linux-gtk-arm64.zip" del "publish\AzTagger-v%VERSION%-linux-gtk-arm64.zip"
REM Create ZIP for win-x64
powershell -Command "Compress-Archive -Path 'publish\win-x64\*.exe','publish\win-x64\*.dll' -DestinationPath 'publish\AzTagger-v%VERSION%-win-x64.zip'"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for win-x64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-win-x64.zip
REM Create ZIP for win-arm64
powershell -Command "Compress-Archive -Path 'publish\win-arm64\*.exe','publish\win-arm64\*.dll' -DestinationPath 'publish\AzTagger-v%VERSION%-win-arm64.zip'"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for win-arm64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-win-arm64.zip
REM Create ZIP for mac-x64 (preserving .app bundle structure)
powershell -Command "Push-Location 'publish\mac-x64'; Compress-Archive -Path 'AzTagger.app' -DestinationPath '..\AzTagger-v%VERSION%-mac-x64.zip'; Pop-Location"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for mac-x64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-mac-x64.zip
REM Create ZIP for mac-arm64 (preserving .app bundle structure)
powershell -Command "Push-Location 'publish\mac-arm64'; Compress-Archive -Path 'AzTagger.app' -DestinationPath '..\AzTagger-v%VERSION%-mac-arm64.zip'; Pop-Location"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for mac-arm64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-mac-arm64.zip
REM Create ZIP for linux-x64
powershell -Command "Compress-Archive -Path 'publish\linux-x64\AzTagger','publish\linux-x64\*.png' -DestinationPath 'publish\AzTagger-v%VERSION%-linux-gtk-x64.zip'"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for linux-x64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-linux-gtk-x64.zip
REM Create ZIP for linux-arm64
powershell -Command "Compress-Archive -Path 'publish\linux-arm64\AzTagger','publish\linux-arm64\*.png' -DestinationPath 'publish\AzTagger-v%VERSION%-linux-gtk-arm64.zip'"
if errorlevel 1 (
echo ERROR: Failed to create ZIP for linux-arm64
exit /b 1
)
echo Created: publish\AzTagger-v%VERSION%-linux-gtk-arm64.zip
echo.
echo Done! All packages created successfully.
echo.
dir /b publish\*.zip 2>nul
endlocal