Skip to content

Commit

Permalink
chore(appveyor)
Browse files Browse the repository at this point in the history
trigger build
  • Loading branch information
igeligel committed Jul 16, 2016
1 parent ae25f92 commit 2168c11
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
40 changes: 40 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 0.1.0-{build}-beta
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
skip_tags: true
before_build:
- ps: >-
(new-object net.webclient).DownloadFile('https://go.microsoft.com/fwlink/?LinkID=809122','core.exe')
core.exe /install /quiet /norestart
dotnet --version
build_script:
- ps: .\Build.ps1
test: off
artifacts:
- path: .\**\artifacts\**\*.nupkg
name: MyGet
deploy:
- provider: NuGet
server: https://www.myget.org/feed/Details/skadiprices-csgofast
api_key:
secure: EmqtrRaJs9WTPky20B0Faa2jfGXU9CxNdImSfyFMEFxyQ62ESLididWSumqSuHCW
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
- provider: NuGet
name: production
api_key:
secure: gyKiWQbl6dIjAKuQE7blJ/6b9ZG11PG5Ys7HPoGRspU7w57UhYCa46Rny/tch2B+
on:
branch: master
appveyor_repo_tag: true

76 changes: 76 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<#
.SYNOPSIS
You can add this to you build script to ensure that psbuild is available before calling
Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically.
#>
function EnsurePsbuildInstalled{
[cmdletbinding()]
param(
[string]$psbuildInstallUri = 'https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1'
)
process{
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
'Installing psbuild from [{0}]' -f $psbuildInstallUri | Write-Verbose
(new-object Net.WebClient).DownloadString($psbuildInstallUri) | iex
}
else{
'psbuild already loaded, skipping download' | Write-Verbose
}

# make sure it's loaded and throw if not
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
throw ('Unable to install/load psbuild from [{0}]' -f $psbuildInstallUri)
}
}
}

# Taken from psake https://github.com/psake/psake

<#
.SYNOPSIS
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
to see if an error occcured. If an error is detected then an exception is thrown.
This function allows you to run command-line programs without having to
explicitly check the $lastexitcode variable.
.EXAMPLE
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
#>
function Exec
{
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
)
& $cmd
if ($lastexitcode -ne 0) {
throw ("Exec: " + $errorMessage)
}
}

cd .\src\skadiprices.csgofast\

if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }

EnsurePsbuildInstalled

exec { & dotnet restore }

#Invoke-MSBuild
Set-MsBuild "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
Invoke-MSBuild

$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)

cd ..\skadiprices.csgofast.test\

dotnet restore

ls

exec { & dotnet test -c release }

cd ..\skadiprices.csgofast\

exec { & dotnet pack -c Release -o .\artifacts }

0 comments on commit 2168c11

Please sign in to comment.