Skip to content

Commit

Permalink
Attempt to wire up Myget
Browse files Browse the repository at this point in the history
Former-commit-id: 124f248
Former-commit-id: 466c7a63ecc3017b861c1ca6ba2dbce55387d028
  • Loading branch information
JimBobSquarePants committed Aug 23, 2015
1 parent 2576a20 commit 3b12087
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ matrix:
environment:
COVERALLS_REPO_TOKEN:
secure: 1hvfHFO3qtGTcwB+AnCGYsn0az0j9MzAux5hee5CFeyRJ+lWut0LjnyqvsI/5Pfa
MYGET_SOURCE: https://www.myget.org/F/imageprocessor/api/v2
MYGET_API_KEY:
secure: fz0rUrt3B1HczUC1ZehwVsrFSWX9WZGDQoueDztLte9/+yQG+BBU7UrO+coE8lUf

#---------------------------------#
# build configuration #
Expand Down Expand Up @@ -58,4 +61,7 @@ artifacts:
# on successful build
on_success:
- ps: Import-Module .\build\psake.psm1
- ps: Invoke-Psake .\build\build.ps1 Publish-Myget -properties @{"MygetApiKey"=$env:MYGET_API_KEY;"MygetSource"=$env:MYGET_SOURCE}
on:
branch: master
- ps: Invoke-Psake .\build\build.ps1 Publish-Nuget -properties @{"NugetApiKey"=$env:APIKEY;"NugetSource"=$env:SOURCE}
19 changes: 16 additions & 3 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
properties {
# call nuget.bat with these values as parameters
$MygetApiKey = $null
$MygetSource = $null
$NugetApiKey = $null
$NugetSource = $null

Expand Down Expand Up @@ -214,17 +216,28 @@ task Generate-Nuget -depends Set-VersionNumber, Build-Solution {
}
}

# publishes the nuget on a feed
# publishes the Myget on a feed
task Publish-Myget {
if ($MygetApiKey -eq $null -or $MygetApiKey -eq "") {
throw New-Object [System.ArgumentException] "You must provide an API key as parameter: 'Invoke-psake Publish-Myget -properties @{`"MygetApiKey`"=`"YOURAPIKEY`"}' ; or add a APIKEY environment variable to AppVeyor"
}

Get-ChildItem $NUGET_OUTPUT -Filter "*.nugpkg" | % {
& $NUGET_EXE push $_ -ApiKey $MygetApiKey -Source $MygetSource
}
}

# publishes the Nuget on a feed
task Publish-Nuget {
if ($NugetApiKey -eq $null -or $NugetApiKey -eq "") {
throw New-Object [System.ArgumentException] "You must provide an API key as parameter: 'Invoke-psake Publish-Nuget -properties @{`"NugetApiKey`"=`"YOURAPIKEY`"}' ; or add a APIKEY environment variable to AppVeyor"
}

Get-ChildItem $NUGET_OUTPUT -Filter "*.nugpkg" | % {
if ($NugetSource -eq $null -or $NugetSource -eq "") {
& $NUGET_EXE push $_ -ApiKey $apikey -Source $NugetSource
& $NUGET_EXE push $_ -ApiKey $NugetApiKey -Source $NugetSource
} else {
& $NUGET_EXE push $_ -ApiKey $apikey
& $NUGET_EXE push $_ -ApiKey $NugetApiKey
}
}
}
Expand Down

0 comments on commit 3b12087

Please sign in to comment.