-
Notifications
You must be signed in to change notification settings - Fork 4
/
appveyor.yml
113 lines (77 loc) · 3.23 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
version: '{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
skip_tags: true
image: Visual Studio 2019
clone_depth: 5
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(APPVEYOR_BUILD_VERSION)
assembly_file_version: $(APPVEYOR_BUILD_VERSION)
assembly_informational_version: $(APPVEYOR_BUILD_VERSION)
install:
- ps: >-
if($($env:APPVEYOR))
{
$firstCommit = $(git log --pretty=format:'%H' -n -1).Length;
$firstCommitHash = $(git log --pretty=format:'%H' -n -1)[$firstCommit-1];
Write-Host "First Commit Hash:" $firstCommitHash;
$firstCommitDate = (git show -s --format=%ci $firstCommitHash);
Write-Host "First Commit Date:" $firstCommitDate;
[datetime]$FCDateTime = $firstCommitDate;
#Write-Host $FCDateTime
$FCyear = $FCDateTime.ToString("y.").TrimEnd('.');
#Write-Host $FCyear
$timeZone0 = [TimeZoneInfo]::ConvertTimeBySystemTimeZoneId([DateTime]::UtcNow, "Turkey Standard Time");
$timeZone = $timeZone0;
Write-Host "Current System Time:" $timeZone;
[datetime]$DateTime = $timeZone;
$year = $DateTime.ToString("y.").TrimEnd('.');
$month = $DateTime.ToString("M.").TrimEnd('.');
$day = $DateTime.ToString("d.").TrimEnd('.');
$hourMinute = $DateTime.ToString(".HHmm").TrimStart('.').TrimStart('0');
$buildYear = (($year - $FCyear) + 1);
#$buildTime = $DateTime.ToString("M.d.hmm");
$newBuildNumber = "$buildYear.$month.$day.$hourMinute";
Write-Host "New Nuget Package Version:" $newBuildNumber
Update-AppveyorBuild -Version $newBuildNumber;
}
else
{
Write-Host "AppVeyor was not detected";
}
build_script:
- ps: >-
if($($env:APPVEYOR))
{
$SVersion = $($env:APPVEYOR_BUILD_VERSION);
Write-Host "$($env:APPVEYOR_PROJECT_NAME) Version:$SVersion";
$myapp = "$($env:APPVEYOR_PROJECT_NAME)";
nuget restore $myapp.sln;
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.5 /p:OutputPath="bin\v4.5";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.5.1 /p:OutputPath="bin\v4.5.1";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.5.2 /p:OutputPath="bin\v4.5.2";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.6 /p:OutputPath="bin\v4.6";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.6.1 /p:OutputPath="bin\v4.6.1";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.6.2 /p:OutputPath="bin\v4.6.2";
#& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=v4.7 /p:OutputPath="bin\v4.7";
& msbuild $myapp.sln /property:Configuration=Release /p:TargetFrameworkVersion=netcoreapp3.0 /p:OutputPath="bin\netcoreapp3.0";
dir -Directory;
Write-Host $myapp;
nuget pack "$myapp.nuspec" -version $newBuildNumber;
Push-AppveyorArtifact "$($env:APPVEYOR_BUILD_FOLDER)\$myapp.$SVersion.nupkg" -FileName "$myapp.$SVersion.nupkg" -DeploymentName "$myapp";
}
else
{
Write-Host "AppVeyor was not detected";
}
test: off
hosts:
api.nuget.org: 93.184.221.200
skip_commits:
files:
- '**/*.md'