diff --git a/.gitignore b/.gitignore index f1e3d20..f60c2b3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +artifacts/ # Visual Studio 2015 cache/options directory .vs/ diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..6334910 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ + +version: 0.0.{build} +install: +- choco install gitversion.portable -pre -y + +before_build: +- ps: gitversion /l console /output buildserver /updateAssemblyInfo + +build_script: +- cmd: build.cmd + +after_build: + - cmd: appveyor PushArtifact "artifacts\Shaper2D.%GitVersion_NuGetVersion%.nupkg" + +deploy: +- provider: NuGet + server: https://www.myget.org/F/shaper2d/api/v2/package + api_key: + secure: SyrSERGrjkK21TSCsHtqke5279SMxXCg2NXKjR2qaErP0khEplwxPwE8Ch5bxzyf + +test: off \ No newline at end of file diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..0ab47bc --- /dev/null +++ b/build.cmd @@ -0,0 +1,34 @@ +@echo Off + +REM No glob support on Windows +dotnet restore +dotnet test ./tests/Shaper2D.Tests/ + +REM run only if gitversion has ran i.e. from appveyor + if not "%GitVersion_NuGetVersion%" == "" ( + cd src/Shaper2D + ECHO Setting version number to "%GitVersion_NuGetVersion%" + dotnet version "%GitVersion_NuGetVersion%" + cd ../../ + if not "%errorlevel%"=="0" goto failure + ) + +ECHO Building nuget packages +if not "%GitVersion_NuGetVersion%" == "" ( + dotnet pack -c Release --output ./artifacts ./src/Shaper2D/project.json +)ELSE ( + dotnet pack -c Release --version-suffix "local-build" --output ./artifacts ./src/Shaper2D/project.json +) +if not "%errorlevel%"=="0" goto failure + +:success +ECHO successfully built project +REM exit 0 +goto end + +:failure +ECHO failed to build. +REM exit -1 +goto end + +:end \ No newline at end of file diff --git a/gitversion.yml b/gitversion.yml new file mode 100644 index 0000000..e07c90f --- /dev/null +++ b/gitversion.yml @@ -0,0 +1,13 @@ +# to create a new package you create a new release/tag +# in github appveyor will build it without the -cixxx tag +# it will then be deployable cleanly to nuget.org + +branches: + master: + tag: ci + mode: ContinuousDeployment + increment: Minor + prevent-increment-of-merged-branch-version: false + track-merge-target: true +ignore: + sha: [] \ No newline at end of file diff --git a/src/Shaper2D/project.json b/src/Shaper2D/project.json index cb286f2..abaf106 100644 --- a/src/Shaper2D/project.json +++ b/src/Shaper2D/project.json @@ -69,5 +69,8 @@ "System.Runtime": "4.0.0" } } + }, + "tools": { + "dotnet-version": "1.1.0" } } \ No newline at end of file