Skip to content

Instantly share code, notes, and snippets.

@crmckenzie
Created December 14, 2015 20:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crmckenzie/ad79d97eb7a24ffc025a to your computer and use it in GitHub Desktop.
Save crmckenzie/ad79d97eb7a24ffc025a to your computer and use it in GitHub Desktop.
Semantically Version NuGet Package Build/Test/Publish with AppVeyor
version: 0.1.0.{build}
environment:
packageVersion: 0.1.0
init:
- ps: $env:buildVersion = "$env:packageVersion.$env:appveyor_build_number"
- ps: $env:nugetVersion = "$env:packageVersion-beta-$env:appveyor_build_number"
- ps: Update-AppveyorBuild -Version $env:buildVersion
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '$(buildVersion)'
assembly_file_version: '$(buildVersion)'
assembly_informational_version: '$(nugetVersion)'
configuration: Release
nuget:
account_feed: true
project_feed: true
disable_publish_on_pr: true
before_build:
- nuget restore
build:
verbosity: minimal
after_build:
- ps: nuget pack MyProject.nuspec -version "$env:nugetVersion"
artifacts:
- path: 'MyProject*.nupkg'
name: nuget-package
deploy:
- provider: NuGet
api_key:
secure: blahblahblah
artifact: nuget-package
on:
branch: master
@kylos101
Copy link

This was really helpful. Thank you!

@stil
Copy link

stil commented Feb 28, 2017

I think it should be without single quotes - otherwise it fails.

  assembly_version: $(buildVersion)
  assembly_file_version: $(buildVersion)
  assembly_informational_version: $(nugetVersion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment