Skip to content

Commit 1d3ec86

Browse files
committed
Adding appveyor build config
1 parent 6491237 commit 1d3ec86

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

GitVersionCore/Helpers/ProcessHelper.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static Process Start(ProcessStartInfo startInfo)
3636
startInfo.FileName,
3737
exception);
3838
}
39-
39+
4040
throw;
4141
}
4242
}
@@ -70,8 +70,14 @@ public static int Run(Action<string> output, Action<string> errorOutput, TextRea
7070
};
7171
foreach (var environmentalVariable in environmentalVariables)
7272
{
73-
if (!psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key) && environmentalVariable.Value != null)
73+
if (psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key))
74+
{
75+
psi.EnvironmentVariables[environmentalVariable.Key] = environmentalVariable.Value;
76+
}
77+
else
78+
{
7479
psi.EnvironmentVariables.Add(environmentalVariable.Key, environmentalVariable.Value);
80+
}
7581
if (psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key) && environmentalVariable.Value == null)
7682
psi.EnvironmentVariables.Remove(environmentalVariable.Key);
7783
}

GitVersionExe.Tests/GitVersionHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static ExecutionResults ExecuteIn(ArgumentBuilder arguments)
3232
var environmentalVariables =
3333
new[]
3434
{
35-
new KeyValuePair<string, string>("TEAMCITY_VERSION", arguments.IsTeamCity ? "8.0.0" : null)
35+
new KeyValuePair<string, string>("TEAMCITY_VERSION", arguments.IsTeamCity ? "8.0.0" : null),
36+
new KeyValuePair<string, string>("APPVEYOR", null)
3637
};
3738

3839
var exitCode = ProcessHelper.Run(

appveyor.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
assembly_info:
2+
patch: false
3+
4+
platform:
5+
- Any CPU
6+
7+
configuration:
8+
- Debug
9+
10+
build_script:
11+
- cmd: nuget restore
12+
13+
- cmd: msbuild GitVersion.sln "/p:Configuration=%CONFIGURATION%;Platform=%PLATFORM%"
14+
- ps: .\NuGetCommandLineBuild\Tools\GitVersion.exe /l console /output buildserver /updateAssemblyInfo
15+
- cmd: msbuild GitVersion.sln "/p:Configuration=%CONFIGURATION%;Platform=%PLATFORM%"
16+
17+
- cmd: appveyor PushArtifact "NuGetExeBuild/GitVersion.Portable.%GitVersion_NuGetVersion%.nupkg"
18+
19+
- cmd: appveyor PushArtifact "NuGetCommandLineBuild/GitVersion.CommandLine.%GitVersion_NuGetVersion%.nupkg"
20+
- cmd: appveyor PushArtifact "NuGetRefBuild/GitVersion.%GitVersion_NuGetVersion%.nupkg"
21+
- cmd: appveyor PushArtifact "NuGetTaskBuild/GitVersionTask.%GitVersion_NuGetVersion%.nupkg"
22+
23+
- cmd: 7z a "GitVersion_%GitVersion_NuGetVersion%.zip" .\NuGetCommandLineBuild\Tools\*.*
24+
- cmd: appveyor PushArtifact "GitVersion_%GitVersion_NuGetVersion%.zip"
25+
26+
test_script:
27+
- nunit-console "GitVersionTask.Tests\bin\%CONFIGURATION%\GitVersionTask.Tests.dll" "GitVersionExe.Tests\bin\%CONFIGURATION%\GitVersionExe.Tests.dll" "GitVersionCore.Tests\bin\%CONFIGURATION%\GitVersionCore.Tests.dll" /noshadow
28+
29+
deploy:
30+
- provider: NuGet
31+
server: http://chocolatey.org
32+
api_key:
33+
secure:
34+
artifact: /GitVersion.Portable\.$(GitVersion_NuGetVersion)\.nupkg/
35+
36+
- provider: NuGet
37+
api_key:
38+
secure:
39+
artifact: /GitVersion.CommandLine\.$(GitVersion_NuGetVersion)\.nupkg/
40+
41+
- provider: NuGet
42+
api_key:
43+
secure:
44+
artifact: /GitVersionTask\.$(GitVersion_NuGetVersion)\.nupkg/
45+
46+
- provider: NuGet
47+
api_key:
48+
secure:
49+
artifact: /GitVersion\.$(GitVersion_NuGetVersion)\.nupkg/
50+
51+
- provider: GitHub
52+
release: v$(GitVersion_SemVer)
53+
tag: v$(GitVersion_SemVer)
54+
auth_token:
55+
secure:
56+
artifact: /GitVersion_$(GitVersion_NuGetVersion).zip/

0 commit comments

Comments
 (0)