MyGet.ps1 1.0 KB

12345678910111213141516171819
  1. # set env vars usually set by MyGet (enable for local testing)
  2. #$env:SourcesPath = '..'
  3. #$env:NuGet = "./nuget.exe" # https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
  4. $nuget = $env:NuGet
  5. Copy-Item $env:SourcesPath\LICENSE $env:SourcesPath\LICENSE.txt # has to be .txt extension, don't check in
  6. # parse the version number out of package.json
  7. $bsversionParts = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version.split('-', 2) # split the version on the '-'
  8. $bsversion = $bsversionParts[0]
  9. if ($bsversionParts.Length -gt 1) {
  10. $bsversion += '-' + $bsversionParts[1].replace('.', '').replace('-', '_') # strip out invalid chars from the PreRelease part
  11. }
  12. # create packages
  13. & $nuget pack "$env:SourcesPath\nuget\bootstrap.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $bsversion
  14. & $nuget pack "$env:SourcesPath\nuget\bootstrap.sass.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $bsversion