Skip to content

Commit 88a02d1

Browse files
committed
Refresh resource file, including build script
1 parent 9ba125e commit 88a02d1

File tree

3 files changed

+21
-38
lines changed

3 files changed

+21
-38
lines changed

appveyor.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ function Invoke-AppVeyorInstall {
4242
# I spent a whole day trying to find a solution but ultimately the only reliable solution
4343
# I was able to come up with is to install in the default location (which is /usr/share/dotnet)
4444
# using 'sudo' because you need admin privileges to access the default install location.
45+
#
46+
# November 2022: I tried removing this workaround since GetVersion.Tool was updated more
47+
# than 2 years ago but it led to another problem: https://ci.appveyor.com/project/Jericho/zoomnet/builds/48579496/job/pymt60j9b53ayxta#L78
48+
#
49+
# Therefore this workaround seems like a permanent solution.
4550

4651
sudo bash dotnet-install.sh --version $desiredDotNetCoreSDKVersion --install-dir /usr/share/dotnet
4752
}

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ before_build:
1717

1818
# to run your custom scripts instead of automatic MSBuild
1919
build_script:
20-
- ps: .\build.ps1 --target=AppVeyor
20+
- ps: .\build.ps1 build.cake --target=AppVeyor
2121

2222
# scripts to run after build
2323
after_build:

build.cake

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Install tools.
22
#tool dotnet:?package=GitVersion.Tool&version=5.12.0
33
#tool dotnet:?package=coveralls.net&version=4.0.1
4-
#tool nuget:?package=GitReleaseManager&version=0.13.0
5-
#tool nuget:?package=ReportGenerator&version=5.1.23
6-
#tool nuget:?package=xunit.runner.console&version=2.5.0
7-
#tool nuget:?package=CodecovUploader&version=0.5.0
4+
#tool nuget:https://f.feedz.io/jericho/jericho/nuget/?package=GitReleaseManager&version=0.17.0-collaborators0003
5+
#tool nuget:?package=ReportGenerator&version=5.2.0
6+
#tool nuget:?package=xunit.runner.console&version=2.6.5
7+
#tool nuget:?package=CodecovUploader&version=0.7.1
88

99
// Install addins.
1010
#addin nuget:?package=Cake.Coveralls&version=1.1.0
@@ -51,9 +51,6 @@ var testCoverageExcludeFiles = new[]
5151
var nuGetApiUrl = Argument<string>("NUGET_API_URL", EnvironmentVariable("NUGET_API_URL"));
5252
var nuGetApiKey = Argument<string>("NUGET_API_KEY", EnvironmentVariable("NUGET_API_KEY"));
5353

54-
var feedzioApiUrl = Argument<string>("FEEDZIO_API_URL", EnvironmentVariable("FEEDZIO_API_URL"));
55-
var feedzioApiKey = Argument<string>("FEEDZIO_API_KEY", EnvironmentVariable("FEEDZIO_API_KEY"));
56-
5754
var gitHubToken = Argument<string>("GITHUB_TOKEN", EnvironmentVariable("GITHUB_TOKEN"));
5855
var gitHubUserName = Argument<string>("GITHUB_USERNAME", EnvironmentVariable("GITHUB_USERNAME"));
5956
var gitHubPassword = Argument<string>("GITHUB_PASSWORD", EnvironmentVariable("GITHUB_PASSWORD"));
@@ -77,8 +74,9 @@ var benchmarkProject = $"{sourceFolder}{libraryName}.Benchmark/{libraryName}.Ben
7774
var buildBranch = Context.GetBuildBranch();
7875
var repoName = Context.GetRepoName();
7976

80-
var versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
81-
var milestone = versionInfo.MajorMinorPatch;
77+
var versionInfo = (GitVersion)null; // Will be calculated in SETUP
78+
var milestone = string.Empty; // Will be calculated in SETUP
79+
8280
var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString();
8381
var isLocalBuild = BuildSystem.IsLocalBuild;
8482
var isMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildBranch);
@@ -119,6 +117,10 @@ Setup(context =>
119117
context.Log.Verbosity = Verbosity.Diagnostic;
120118
}
121119

120+
Information("Calculating version info...");
121+
versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
122+
milestone = versionInfo.MajorMinorPatch;
123+
122124
Information("Building version {0} of {1} ({2}, {3}) using version {4} of Cake",
123125
versionInfo.LegacySemVerPadded,
124126
libraryName,
@@ -135,11 +137,6 @@ Setup(context =>
135137
isTagged
136138
);
137139

138-
Information("Feedz.io Info:\r\n\tApi Url: {0}\r\n\tApi Key: {1}",
139-
feedzioApiUrl,
140-
string.IsNullOrEmpty(feedzioApiKey) ? "[NULL]" : new string('*', feedzioApiKey.Length)
141-
);
142-
143140
Information("Nuget Info:\r\n\tApi Url: {0}\r\n\tApi Key: {1}",
144141
nuGetApiUrl,
145142
string.IsNullOrEmpty(nuGetApiKey) ? "[NULL]" : new string('*', nuGetApiKey.Length)
@@ -311,6 +308,8 @@ Task("Upload-Coverage-Result-Coveralls")
311308
.WithCriteria(() => isMainRepo)
312309
.Does(() =>
313310
{
311+
if(string.IsNullOrEmpty(coverallsToken)) throw new InvalidOperationException("Could not resolve Coveralls token.");
312+
314313
CoverallsNet(new FilePath(coverageFile), CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
315314
{
316315
RepoToken = coverallsToken,
@@ -331,6 +330,8 @@ Task("Upload-Coverage-Result-Codecov")
331330
.WithCriteria(() => isMainRepo)
332331
.Does(() =>
333332
{
333+
if(string.IsNullOrEmpty(codecovToken)) throw new InvalidOperationException("Could not resolve CodeCov token.");
334+
334335
Codecov(new CodecovSettings
335336
{
336337
Files = new[] { coverageFile },
@@ -420,28 +421,6 @@ Task("Publish-NuGet")
420421
}
421422
});
422423

423-
Task("Publish-Feedzio")
424-
.IsDependentOn("Create-NuGet-Package")
425-
.WithCriteria(() => !isLocalBuild)
426-
.WithCriteria(() => !isPullRequest)
427-
.WithCriteria(() => isMainRepo)
428-
.Does(() =>
429-
{
430-
if(string.IsNullOrEmpty(feedzioApiKey)) throw new InvalidOperationException("Could not resolve Feedz.io API key.");
431-
if(string.IsNullOrEmpty(feedzioApiUrl)) throw new InvalidOperationException("Could not resolve Feedz.io API url.");
432-
433-
var settings = new DotNetNuGetPushSettings
434-
{
435-
Source = feedzioApiUrl,
436-
ApiKey = feedzioApiKey
437-
};
438-
439-
foreach(var package in GetFiles(outputDir + "*.nupkg"))
440-
{
441-
DotNetNuGetPush(package, settings);
442-
}
443-
});
444-
445424
Task("Create-Release-Notes")
446425
.Does(() =>
447426
{
@@ -544,7 +523,6 @@ Task("AppVeyor")
544523
.IsDependentOn("Upload-Coverage-Result-Codecov")
545524
.IsDependentOn("Create-NuGet-Package")
546525
.IsDependentOn("Upload-AppVeyor-Artifacts")
547-
.IsDependentOn("Publish-Feedzio")
548526
.IsDependentOn("Publish-NuGet")
549527
.IsDependentOn("Publish-GitHub-Release")
550528
.Finally(() =>

0 commit comments

Comments
 (0)