Skip to content

Commit

Permalink
Add CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeBiellik committed Dec 28, 2018
1 parent 3961780 commit 271b027
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: "{build}"

image: Visual Studio 2017
configuration: Release
platform: Any CPU
clone_depth: 1

cache:
- packages -> **\packages.config

install:
- ps: >-
$name = Select-String -Path nfive.yml -Pattern 'name: ?(.+)$' | %{ $_.Matches[0].Groups[1].Value }
If ($env:APPVEYOR_REPO_PROVIDER -eq "github" -and $env:APPVEYOR_REPO_NAME -ne $name) {
Add-AppveyorMessage -Message "Plugin name mismatch" -Category Error -Details "The GitHub repo name '$env:APPVEYOR_REPO_NAME' does not match the plugin name '$name' from nfive.yml."
Write-Host "Plugin name mismatch: The GitHub repo name '$env:APPVEYOR_REPO_NAME' does not match the plugin name '$name' from nfive.yml." -ForegroundColor Red
$host.SetShouldExit(1)
}
$env:BUILD_VERSION = Select-String -Path nfive.yml -Pattern 'version: ?(.+)$' | %{ $_.Matches[0].Groups[1].Value }
If ($env:APPVEYOR_REPO_TAG -eq $true) {
$tag = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
If ($tag -ne $env:BUILD_VERSION) {
Add-AppveyorMessage -Message "Plugin version mismatch" -Category Error -Details "The Git tag '$tag' does not match the plugin version number '$env:BUILD_VERSION' from nfive.yml."
Write-Host "Plugin version mismatch: The Git tag '$tag' does not match the plugin version number '$env:BUILD_VERSION' from nfive.yml." -ForegroundColor Red
$host.SetShouldExit(1)
}
}
$env:BUILD_VERSION_FILE = "$env:BUILD_VERSION.$env:APPVEYOR_BUILD_NUMBER"
$version = $env:BUILD_VERSION -split '-'
$env:BUILD_VERSION_FRIENDLY = $version[0] -replace "(\.0)$"
If ($version[1]) {
$env:BUILD_VERSION_FILE = "$($version[0]).$env:APPVEYOR_BUILD_NUMBER-$($version[1])"
$end = (Get-Culture).TextInfo.ToTitleCase($version[1].Replace("rc", "RC"))
$env:BUILD_VERSION_FRIENDLY += " " + $end -replace "([a-z]+)(\d+)",'$1 $2'
}
Update-AppveyorBuild -Version $env:BUILD_VERSION_FILE
assembly_info:
patch: true
file: Properties\AssemblyInfo.cs
assembly_version: $(BUILD_VERSION)
assembly_file_version: $(BUILD_VERSION_FILE)
assembly_informational_version: $(BUILD_VERSION_FRIENDLY)

before_build:
- cmd: nuget restore
- ps: Start-FileDownload https://ci.appveyor.com/api/projects/NFive/nfpm/artifacts/bin/Release/nfpm.exe
- cmd: nfpm install

build:
verbosity: minimal

after_build:
- ps: 7z a "$($env:APPVEYOR_PROJECT_NAME).zip" *.dll nfive.yml nfive.lock README.md LICENSE Overlays/

artifacts:
- path: $(APPVEYOR_PROJECT_NAME).zip

deploy:
release: $(APPVEYOR_REPO_TAG_NAME)
provider: GitHub
auth_token:
secure: 11Aj9GejhzBxJlpQAwmcgJKINliGVNQ/mWTTFZCylmKiwglzys7hWxRZiRfT7INp
on:
branch: master
APPVEYOR_REPO_TAG: true

0 comments on commit 271b027

Please sign in to comment.