Skip to content

Commit

Permalink
Publish scripts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Dec 27, 2016
1 parent 57c6d11 commit 12bf415
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 168 deletions.
41 changes: 0 additions & 41 deletions src/Tools/build/DotVVM.AspNetCore.nuspec

This file was deleted.

40 changes: 0 additions & 40 deletions src/Tools/build/DotVVM.Core.nuspec

This file was deleted.

27 changes: 0 additions & 27 deletions src/Tools/build/DotVVM.Owin.nuspec

This file was deleted.

53 changes: 0 additions & 53 deletions src/Tools/build/DotVVM.nuspec

This file was deleted.

54 changes: 47 additions & 7 deletions src/Tools/build/publish.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
param([String]$version, [String]$apiKey, [String]$server, [String]$branchName, [String]$repoUrl)
param([String]$version, [String]$apiKey, [String]$server, [String]$branchName, [String]$repoUrl, [String]$nugetRestoreAltSource)


### Helper Functions

function Invoke-Git {
<#
.Synopsis
Wrapper function that deals with Powershell's peculiar error output when Git uses the error stream.
.Example
Invoke-Git ThrowError
$LASTEXITCODE
#>
[CmdletBinding()]
param(
[parameter(ValueFromRemainingArguments=$true)]
[string[]]$Arguments
)

& {
[CmdletBinding()]
param(
[parameter(ValueFromRemainingArguments=$true)]
[string[]]$InnerArgs
)
git.exe $InnerArgs 2>&1
} -ErrorAction SilentlyContinue -ErrorVariable fail @Arguments

if ($fail) {
$fail.Exception
}
}

function CleanOldGeneratedPackages() {
foreach ($package in $packages) {
Expand All @@ -25,7 +58,7 @@ function SetVersion() {
function BuildPackages() {
foreach ($package in $packages) {
cd .\$($package.Directory)
& dotnet restore
& dotnet restore --source $nugetRestoreAltSource --source https://nuget.org/api/v2/
& dotnet pack
cd ..
}
Expand All @@ -38,24 +71,31 @@ function PushPackages() {
}

function GitCheckout() {
& git checkout $branchName 2>&1
& git -c http.sslVerify=false pull $repoUrl 2>&1
invoke-git checkout $branchName
invoke-git -c http.sslVerify=false pull $repoUrl $branchName
}

function GitPush() {
& git commit -am "NuGet package version $version"
& git rebase HEAD $branchName
& git -c http.sslVerify=false push $repoUrl $branchName 2>&1
invoke-git commit -am "NuGet package version $version"
invoke-git rebase HEAD $branchName
invoke-git -c http.sslVerify=false push $repoUrl $branchName
}



### Configuration

$packages = @(
[pscustomobject]@{ Package = "DotVVM.Core"; Directory = "DotVVM.Core" },
[pscustomobject]@{ Package = "DotVVM"; Directory = "DotVVM.Framework" },
[pscustomobject]@{ Package = "DotVVM.Owin"; Directory = "DotVVM.Framework.Hosting.Owin" },
[pscustomobject]@{ Package = "DotVVM.AspNetCore"; Directory = "DotVVM.Framework.Hosting.AspNetCore" }
)



### Publish Workflow

$versionWithoutPre = $version
if ($versionWithoutPre.Contains("-")) {
$versionWithoutPre = $versionWithoutPre.Substring(0, $versionWithoutPre.IndexOf("-"))
Expand Down

0 comments on commit 12bf415

Please sign in to comment.