Skip to content

Commit

Permalink
Merge branch 'release/0.103.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jan 8, 2024
2 parents 70ac0ec + 34c43b3 commit fe220c4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.2.0",
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
8 changes: 4 additions & 4 deletions Source/StrongGrid/WebhookParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public Event[] ParseEventsWebhook(string requestBody)
/// <returns>The <see cref="InboundEmail"/>.</returns>
public async Task<InboundEmail> ParseInboundEmailWebhookAsync(Stream stream, CancellationToken cancellationToken = default)
{
// It's important to rewind the stream
stream.Position = 0;
// It's important to rewind the stream (but only if permitted)
if (stream.CanSeek) stream.Position = 0;

// Asynchronously parse the multipart content received from SendGrid
var parser = await SendGridMultipartFormDataParser.ParseAsync(stream, cancellationToken).ConfigureAwait(false);
Expand All @@ -183,8 +183,8 @@ public async Task<InboundEmail> ParseInboundEmailWebhookAsync(Stream stream, Can
[Obsolete("Use the async version of this method, it can read the content of the stream much more efficiently.")]
public InboundEmail ParseInboundEmailWebhook(Stream stream)
{
// It's important to rewind the stream
stream.Position = 0;
// It's important to rewind the stream (but only if permitted)
if (stream.CanSeek) stream.Position = 0;

// Parse the multipart content received from SendGrid
var parser = SendGridMultipartFormDataParser.Parse(stream);
Expand Down
5 changes: 5 additions & 0 deletions appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ function Invoke-AppVeyorInstall {
# I spent a whole day trying to find a solution but ultimately the only reliable solution
# I was able to come up with is to install in the default location (which is /usr/share/dotnet)
# using 'sudo' because you need admin privileges to access the default install location.
#
# November 2022: I tried removing this workaround since GetVersion.Tool was updated more
# than 2 years ago but it led to another problem: https://ci.appveyor.com/project/Jericho/zoomnet/builds/48579496/job/pymt60j9b53ayxta#L78
#
# Therefore this workaround seems like a permanent solution.

sudo bash dotnet-install.sh --version $desiredDotNetCoreSDKVersion --install-dir /usr/share/dotnet
}
Expand Down
17 changes: 13 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Install tools.
#tool dotnet:?package=GitVersion.Tool&version=5.12.0
#tool dotnet:?package=coveralls.net&version=4.0.1
#tool nuget:?package=GitReleaseManager&version=0.16.0
#tool nuget:https://f.feedz.io/jericho/jericho/nuget/?package=GitReleaseManager&version=0.17.0-collaborators0003
#tool nuget:?package=ReportGenerator&version=5.2.0
#tool nuget:?package=xunit.runner.console&version=2.6.1
#tool nuget:?package=xunit.runner.console&version=2.6.5
#tool nuget:?package=CodecovUploader&version=0.7.1

// Install addins.
Expand Down Expand Up @@ -74,8 +74,9 @@ var benchmarkProject = $"{sourceFolder}{libraryName}.Benchmark/{libraryName}.Ben
var buildBranch = Context.GetBuildBranch();
var repoName = Context.GetRepoName();

var versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
var milestone = versionInfo.MajorMinorPatch;
var versionInfo = (GitVersion)null; // Will be calculated in SETUP
var milestone = string.Empty; // Will be calculated in SETUP

var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString();
var isLocalBuild = BuildSystem.IsLocalBuild;
var isMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildBranch);
Expand Down Expand Up @@ -116,6 +117,10 @@ Setup(context =>
context.Log.Verbosity = Verbosity.Diagnostic;
}
Information("Calculating version info...");
versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
milestone = versionInfo.MajorMinorPatch;
Information("Building version {0} of {1} ({2}, {3}) using version {4} of Cake",
versionInfo.LegacySemVerPadded,
libraryName,
Expand Down Expand Up @@ -303,6 +308,8 @@ Task("Upload-Coverage-Result-Coveralls")
.WithCriteria(() => isMainRepo)
.Does(() =>
{
if(string.IsNullOrEmpty(coverallsToken)) throw new InvalidOperationException("Could not resolve Coveralls token.");
CoverallsNet(new FilePath(coverageFile), CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
{
RepoToken = coverallsToken,
Expand All @@ -323,6 +330,8 @@ Task("Upload-Coverage-Result-Codecov")
.WithCriteria(() => isMainRepo)
.Does(() =>
{
if(string.IsNullOrEmpty(codecovToken)) throw new InvalidOperationException("Could not resolve CodeCov token.");
Codecov(new CodecovSettings
{
Files = new[] { coverageFile },
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.404",
"version": "8.0.100",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down

0 comments on commit fe220c4

Please sign in to comment.