1- You can perform all the steps in this file by simply ` executing publish-choco-win64.ps1 ` in the project folder. Be
1+ You can perform all the steps in this file by simply ` executing publish-choco-win64.ps1 ` in the project folder. Be
22aware that before doing so you must:
33
441 . Increase the version number in the csproj.
@@ -8,51 +8,5 @@ aware that before doing so you must:
88# Generate self-contained EXE for Windows x64
99
10101 . Open the Ui.Console folder in a PowerShell command prompt on Windows.
11- 2 . Execute the dotnet publish command for self-contained EXE and Windows:
12-
13- ```
14- dotnet publish -c Release
15- ```
16-
17- 3. Calculate the new Hash:
18-
19- ```
20- $hashExe = Get-FileHash .\bin\Release\net9.0\publish\pping.exe | Select -ExpandProperty Hash
21- $hashDll = Get-FileHash .\bin\Release\net9.0\publish\pping.dll | Select -ExpandProperty Hash
22- ```
23-
24- 4. Replace property in verification.txt:
25-
26- ```
27- (Get-Content verification.txt) -replace '- pping.exe \(SHA256: (.*)', "- pping.exe (SHA256: $hashExe)" | Out-File verification.txt
28- (Get-Content verification.txt) -replace '- pping.dll \(SHA256: (.*)', "- pping.exe (SHA256: $hashDll)" | Out-File verification.txt
29- ```
30-
31- 5. Copy additional files to publish-folder:
32-
33- ```
34- cp pping.nuspec .\bin\Release\net9.0\win-x64\publish\pping.nuspec
35- cp verification.txt .\bin\Release\net9.0\win-x64\publish\verification.txt
36- cp license.txt .\bin\Release\net9.0\win-x64\publish\license.txt
37- cp pping.runtimeconfig.json .\bin\Release\net9.0\win-x64\publish\pping.runtimeconfig.json
38- ```
39-
40- 6. Generate choco package:
41-
42- ```
43- choco pack .\bin\Release\net9.0\win-x64\publish\pping.nuspec --output-directory .\bin\Release\net9.0\win-x64\publish\
44- ```
45-
46- 7. Get version out of nuspec:
47-
48- ```
49- $xmlFile = ".\bin\Release\net9.0\win-x64\publish\pping.nuspec"
50- [XML]$xml = Get-Content $xmlFile
51- $version = $xml.package.metadata.version
52- ```
53-
54- 8. Push choco:
55-
56- ```
57- choco push .\bin\Release\net9.0\win-x64\publish\pping.$version.nupkg
58- ```
11+ 2 . Define the ENV variable ` CHOCO_API_KEY ` with ` $env:CHOCO_API_KEY="THEKEY" ` .
12+ 2 . Execute the script ` .\publish-choco.ps1 `
0 commit comments