File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ # build release packages
2
+
3
+
4
+ Function Build ($dir , $arch )
5
+ {
6
+ # clean dir
7
+ if (Test-Path $dir )
8
+ {
9
+ Remove-Item $dir - Recurse - Force
10
+ }
11
+ dotnet publish - c Release / p:PublishSingleFile= true -- runtime $arch -- framework $framework WebAPI
12
+ }
13
+
14
+ Function Pack ($dir , $arch )
15
+ {
16
+
17
+ mkdir - p $dir \CharacterEditor\Resources
18
+ # copy resources
19
+ xcopy / y / s / e CharacterEditor\Resources $dir \CharacterEditor\Resources
20
+ # create zip archive in the root
21
+ & $zip_exe a - mpass= 10 " api.pvpgn.pro_${version} _$arch .zip" .\$dir \*
22
+ }
23
+
24
+
25
+ $version = Select-String - Path .\WebAPI\WebAPI.csproj - Pattern ' <Version>(.*)</Version>' - AllMatches | % { $_.Matches.Groups [1 ] } | % { $_.Value }
26
+
27
+ $framework = " netcoreapp3.1"
28
+ $rdir = " WebAPI\bin\Release\$framework "
29
+ $zip_exe = " C:\Program Files\7-Zip\7z.exe"
30
+
31
+
32
+ echo " Framework: $framework "
33
+ echo " App Version: $version "
34
+ echo " "
35
+
36
+ # build for every architecture
37
+ $arch = " win-x64"
38
+ $publish = " $rdir \$arch \publish"
39
+ Build $publish $arch
40
+ Pack $publish $arch
41
+
42
+ $arch = " linux-x64"
43
+ $publish = " $rdir \$arch \publish"
44
+ Build $publish $arch
45
+ Pack $publish $arch
46
+
47
+ $arch = " osx-x64"
48
+ $publish = " $rdir \$arch \publish"
49
+ Build $publish $arch
50
+ Pack $publish $arch
51
+
You can’t perform that action at this time.
0 commit comments