mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
automatically update readme example versions when packing nuget
This commit is contained in:
@@ -94,8 +94,8 @@ Windows apps should be as fast and as easy to install and update as apps like Go
|
||||
5. Create a Squirrel release using the `Squirrel.exe` command line tool.
|
||||
The tool can be downloaded from GitHub Releases, and it is also bundled into the [Clowd.Squirrel](https://www.nuget.org/packages/Clowd.Squirrel/) nuget package.
|
||||
If installed through NuGet, the tools can usually be found at:
|
||||
- `%userprofile%\.nuget\packages\Clowd.Squirrel\<Clowd.Squirrel version>\tools`, or;
|
||||
- `..\packages\Clowd.Squirrel\<Clowd.Squirrel version>\tools`
|
||||
- `%userprofile%\.nuget\packages\clowd.squirrel\2.7.89-pre\tools`, or;
|
||||
- `..\packages\clowd.squirrel\2.7.89-pre\tools`
|
||||
|
||||
Once you have located the tools folder, create a release. Minimal example below with some useful options, but explore `Squirrel.exe -h` for a complete list.
|
||||
```cmd
|
||||
|
||||
12
pack.ps1
12
pack.ps1
@@ -1,3 +1,6 @@
|
||||
using namespace System.IO
|
||||
using namespace System.Text.RegularExpressions
|
||||
|
||||
Set-Location "$PSScriptRoot"
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
@@ -5,9 +8,16 @@ $ErrorActionPreference = "Stop"
|
||||
$gitVerJson = (&nbgv get-version -f json) | ConvertFrom-Json
|
||||
$version = $gitVerJson.SimpleVersion + $gitVerJson.PrereleaseVersion
|
||||
|
||||
# build nuget package
|
||||
& "$PSScriptRoot\vendor\NuGet.exe" pack "$PSScriptRoot\src\Clowd.Squirrel.nuspec" `
|
||||
-BasePath "$PSScriptRoot\src" `
|
||||
-OutputDirectory "$PSScriptRoot\build" `
|
||||
-Version $version
|
||||
|
||||
& "$PSScriptRoot\vendor\7zip\7z.exe" a "$PSScriptRoot\build\SquirrelTools-$version.zip" -tzip -aoa -y -mmt on "$PSScriptRoot\build\publish\*"
|
||||
# build zip for github releases
|
||||
& "$PSScriptRoot\vendor\7zip\7z.exe" a "$PSScriptRoot\build\SquirrelTools-$version.zip" -tzip -aoa -y -mmt on "$PSScriptRoot\build\publish\*"
|
||||
|
||||
# update readme examples with latest version
|
||||
$readmePath = "$PSScriptRoot\README.md"
|
||||
$newText = [Regex]::Replace([File]::ReadAllText($readmePath), "Clowd\.Squirrel\\.+?\\tools", "clowd.squirrel\$version\tools", [RegexOptions]::Multiline + [RegexOptions]::IgnoreCase)
|
||||
[File]::WriteAllText($readmePath, $newText)
|
||||
Reference in New Issue
Block a user