Closed Smaug123 closed 4 months ago
// I *believe* it is impossible to have a fixed (not floating) version number from a source reference
// via `dotnet pack`. Without this next bit, FsCheck.Xunit vA.B.C depends on >= FsCheck vA.B.C, not
// on FsCheck exactly at vA.B.C.
Have we also lost the NUnit (>= 3.13.1 && < 4.0.0)
now? It seems to have turned into NUnit (>= 3.13.1)
. Is there something in dotnet pack that can specify that like paket.template?
Are you observing that? I see the correct bound.
And indeed when I unzip the FsCheck.NUnit.nupkg file and look at its nuspec, it correctly says:
<dependency id="FsCheck" version="[3.0.0-rc2]" exclude="Build,Analyzers" />
<dependency id="NUnit" version="[3.13.1, 4.0.0)" exclude="Build,Analyzers" />
Ah, is it the line in Directory.packages.props
that does it?
<PackageVersion Include="NUnit" Version="[3.13.1,4.0.0)" />
That's alirght then.
Push worked btw, I just pushed rc2. But I think I messed up the xunit dependency restriction. Luckily there is no v3 of xunit so no harm no foul, I hope.
That's the line, yep. You'll want this:
<PackageVersion Include="xunit.extensibility.execution" Version="[2.4.1, 3.0.0)" />
in Directory.Packages.props.
This always fails with "Forbidden". I've regenerated my token. It has I think the right permissions (see below). I set the token as env variable in exactly the same way as NUGET_KEY, which works.
Clearly either my token is missing some permissions, or it's somehow not being passed correctly. I've checked the header and it looks fine, compared to the docs. https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release
Any ideas?
use client = new HttpClient ()
client.DefaultRequestHeaders.Add ("Accept", "application/vnd.github+json")
client.DefaultRequestHeaders.Add ("X-GitHub-Api-Version", "2022-11-28")
client.DefaultRequestHeaders.Authorization <- AuthenticationHeaderValue ("Bearer", pat)
let postData = JsonSerializer.Serialize releaseSpec
use content = new StringContent (postData, Encoding.UTF8, "application/json")
use response = client.PostAsync($"https://api.github.com/repos/%s{gitOwner}/%s{gitName}/releases", content).Result.EnsureSuccessStatusCode()
let response = response.Content.ReadAsStringAsync().Result
let output = JsonSerializer.Deserialize<GitHubReleaseResponse> response
Let me set up a toy repo and try it.
Worked just now with a curl. So my token must be ok, it's just not being set in the header correctly somehow.
Currently you're setting Authorization twice (client.DefaultRequestHeaders.Add ("Authorization", "2022-11-28")
) - that's my bad, you need to delete that line. Haven't worked out if that's the only problem yet.
Yeah, did that, with that it didn't work at all. (See my commit on master just now). After that I get the Forbidden error.
Fixed up the release manually for now, no rush. Stepping away from computer now for a while.
Got it - I need to learn never to use anything other than SendAsync
, because all the helpers are liable to hide crucial information and this catches me out very regularly. The problem is https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28#user-agent ("you need a user agent").
I've raised the fix as https://github.com/fscheck/FsCheck/pull/665 .
Look at moving to NerdBank.GitVersioning;
From a quick look, this doesn't do what we want (i.e. read the release notes and pick up the version from there). It seems to require a separate json file with the verison in it. If that's the case, I'd prefer just keeping the fake dependency for this, I don't think it'll get in the way much.
Fair enough!
Oh nooooo, it looks like dotnet pack
interprets commas in -p:PackageReleaseNotes=
:
The failed process call (note that this is almost all a command line):
Process 'dotnet' failed with nonzero exit code 1. Args: pack --configuration Release -p:Version=3.0.0-rc2 --output bin -p:PackageReleaseNotes=Breaking change: confusingly named `StringNoNnulls` is renamed to `StringNoNullChar`.
Breaking change: The operators `|@`, `@|` and `%>` are removed. Please use `Prop.label` instead.
Negative decimals are now also generated. (by Stephen Smith)
Relaxed FsCheck.Xunit's restriction on xUnit versions. (by Tom Rijnbeek)
Made `Gen.choose64` public.
Removed dependency on FAKE and paket in favor of standard .NET tools. (by Patrick Stevens)
Added more `ForAll` overloads for various `Task` types.
The collections types `NonEmptySet`, `NonEmptyArray` and `FixedLengthArray` now implemented `IEnnumerable` to avoid a call to `Get` in common scenarios..
Stdout of dotnet pack
:
MSBuild version 17.8.3+195e7f5a3 for .NET
MSBUILD : error MSB1006: Property is not valid.
Switch: `@|` and `%>` are removed. Please use `Prop.label` instead.
Negative decimals are now also generated. (by Stephen Smith)
Relaxed FsCheck.Xunit's restriction on xUnit versions. (by Tom Rijnbeek)
Made `Gen.choose64` public.
Removed dependency on FAKE and paket in favor of standard .NET tools. (by Patrick Stevens)
Added more `ForAll` overloads for various `Task` types.
The collections types `NonEmptySet`
For switch syntax, type "MSBuild -help"
I'll put it in an env var instead.
I can try to avoid commas in the release notes ;)
On the plus side, Appveyor does now catch that error! https://ci.appveyor.com/project/kurtschelfthout/fscheck/builds/49266851
Oh my god, MsBuild itself appears to perform XML escaping on the ampersands I am trying to use to perform XML escaping. If we can get XML-escaped lines in there then they will correctly be shown in the release notes:
But I can't get them in there.
Gone with some truly amazing hacks (https://github.com/fscheck/FsCheck/pull/672)
(For after https://github.com/fscheck/FsCheck/pull/662 because it will conflict.)
dotnet pack
will succeed. This should be a simple matter of adding the dependency fromCI
onPack
.WatchDocs
from printing out empty stdout every 10sbuild.fsx
dotnet pack
release notes need to be escaped or passed via other means (see latest AppVeyor builds)