-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8697c7
commit 659e6ed
Showing
4 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,3 +232,5 @@ _Pvt_Extensions | |
|
||
# FAKE - F# Make | ||
.fake/ | ||
|
||
.artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<# | ||
.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) | ||
} | ||
} | ||
|
||
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } | ||
|
||
EnsurePsbuildInstalled | ||
|
||
exec { & dotnet restore } | ||
|
||
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; | ||
$revision = "{0:D}" -f [convert]::ToInt32($revision, 10) | ||
|
||
exec { & dotnet publish -c Release -r win10-x64 -o .\artifacts/win10-x64 --version-suffix=$revision } | ||
exec { & dotnet publish -c Release -r osx.10.10-x64 -o .\artifacts/osx.10.10-x64 --version-suffix=$revision } | ||
exec { & dotnet publish -c Release -r ubuntu.14.04-x64 -o .\artifacts/ubuntu.14.04-x64 --version-suffix=$revision } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '{build}' | ||
pull_requests: | ||
do_not_increment_build_number: true | ||
branches: | ||
only: | ||
- master | ||
nuget: | ||
disable_publish_on_pr: true | ||
build_script: | ||
- ps: .\Build.ps1 | ||
test: off | ||
artifacts: | ||
- path: .\artifacts\win10-x64 | ||
name: dbf-win10-x64 | ||
- path: .\artifacts\osx.10.10-x64 | ||
name: dbf-osx.10.10-x64 | ||
- path: .\artifacts\ubuntu.14.04-x64 | ||
name: dbf-ubuntu.14.04-x64 | ||
deploy: | ||
description: 'Release description' | ||
provider: GitHub | ||
auth_token: | ||
secure: zIuIoM6+3Bc95kSVegG4Lwls01vu+J5OlwOFG2CSaB2YLNdYsTtNqJVnWrnIXMBl | ||
artifact: artifacts\dbf-win10-x64.zip,artifacts\dbf-osx.10.10-x64.zip,artifacts\dbf-ubuntu.14.04-x64.zip | ||
draft: false | ||
prerelease: false | ||
on: | ||
branch: master | ||
appveyor_repo_tag: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters