From 94625e2c8898ff7794fe0b2632b4d5c7ae31f9b0 Mon Sep 17 00:00:00 2001 From: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Date: Mon, 6 Feb 2023 21:12:09 +0000 Subject: [PATCH 1/5] reoves the old implemetnation of sourcelink and uses the newer one present in the .net SDK --- .config/dotnet-tools.json | 6 ---- .github/workflows/netcore.yml | 2 +- .github/workflows/publish.yml | 2 +- CONTRIBUTING.md | 4 +-- Octokit.Reactive/Octokit.Reactive.csproj | 9 ++++++ Octokit/Octokit.csproj | 9 ++++++ build.ps1 | 2 -- build/Context.cs | 1 - build/Lifetime.cs | 2 -- build/Tasks/Build.cs | 3 +- build/Tasks/Default.cs | 2 -- build/Tasks/TestSourceLink.cs | 36 ------------------------ docs/debugging-source.md | 8 +++--- docs/shipping-releases.md | 2 +- 14 files changed, 28 insertions(+), 60 deletions(-) delete mode 100644 build/Tasks/TestSourceLink.cs diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 83c3421af3..7f35d2cb13 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,12 +2,6 @@ "version": 1, "isRoot": true, "tools": { - "sourcelink": { - "version": "3.1.1", - "commands": [ - "sourcelink" - ] - }, "dotnet-format": { "version": "5.1.250801", "commands": [ diff --git a/.github/workflows/netcore.yml b/.github/workflows/netcore.yml index 3eb5a4e2cf..8808440e6c 100644 --- a/.github/workflows/netcore.yml +++ b/.github/workflows/netcore.yml @@ -28,5 +28,5 @@ jobs: with: dotnet-version: 6.0.* - name: Build with dotnet - run: ./build.sh --linksources=true --verbosity=verbose + run: ./build.sh --verbosity=verbose shell: bash diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8741faedfd..be35bbd487 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: with: dotnet-version: 6.0.* - name: Build with dotnet - run: ./build.sh --linksources=true --verbosity=verbose + run: ./build.sh --verbosity=verbose shell: bash - name: Publish to NuGet diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 512fdc506b..55a7f2a190 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,11 +72,11 @@ To install dependencies and run the CAKE build script use the following wrapper - Windows (Powershell) -`.\build.ps1 -Target -Configuration Release -LinkSources [Additional Parameters]` +`.\build.ps1 -Target -Configuration Release [Additional Parameters]` - Linux/OSX (bash) -`./build.sh --target= --configuration==Release --linksources=true [Additional Parameters]` +`./build.sh --target= --configuration==Release [Additional Parameters]` ### Running Tests diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index e8de439ecb..35bae79663 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -22,6 +22,15 @@ $(NoWarn);1591;1701;1702;1705 + + true + + + true + + + true + snupkg diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index a55742391c..654a736de9 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -22,6 +22,15 @@ $(DefineConstants);SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;SIMPLE_JSON_TYPEINFO $(NoWarn);1591;1701;1702;1705 + + true + + + true + + + true + snupkg diff --git a/build.ps1 b/build.ps1 index c9d1cbf897..e98303f250 100644 --- a/build.ps1 +++ b/build.ps1 @@ -24,7 +24,6 @@ Param( [string]$Target = "Default", [ValidateSet("Release", "Debug")] [string]$Configuration = "Release", - [switch]$LinkSources, [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] [string]$Verbosity = "Normal", [switch]$WhatIf, @@ -98,7 +97,6 @@ if (!(Test-Path $NugetPath)) { $Arguments = @{ target=$Target; configuration=$Configuration; - linkSources=$LinkSources; verbosity=$Verbosity; dryrun=$WhatIf; }.GetEnumerator() | %{"--{0}=`"{1}`"" -f $_.key, $_.value }; diff --git a/build/Context.cs b/build/Context.cs index 95ab580761..6035d8dc9e 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -9,7 +9,6 @@ public class Context : FrostingContext { public string Target { get; set; } public new string Configuration { get; set; } - public bool LinkSources { get; set; } public bool FormatCode { get; set; } public BuildVersion Version { get; set; } diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 310841b202..0e2d5a1ecd 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -12,7 +12,6 @@ public override void Setup(Context context) { context.Target = context.Argument("target", "Default"); context.Configuration = context.Argument("configuration", "Release"); - context.LinkSources = context.Argument("linkSources", false); context.FormatCode = context.Argument("formatCode", false); context.Artifacts = "./packaging/"; @@ -62,7 +61,6 @@ public override void Setup(Context context) context.Information("Version: {0}", context.Version.Prefix); context.Information("Version suffix: {0}", context.Version.Suffix); context.Information("Configuration: {0}", context.Configuration); - context.Information("LinkSources: {0}", context.LinkSources); context.Information("Target: {0}", context.Target); context.Information("AppVeyor: {0}", context.AppVeyor); context.Information("GitHub Actions: {0}", context.GitHubActions); diff --git a/build/Tasks/Build.cs b/build/Tasks/Build.cs index 2e1af6c0ac..23c3e1c1f8 100644 --- a/build/Tasks/Build.cs +++ b/build/Tasks/Build.cs @@ -13,8 +13,7 @@ public override void Run(Context context) { Configuration = context.Configuration, ArgumentCustomization = args => args - .Append("/p:Version={0}", context.Version.GetSemanticVersion()) - .Append("/p:SourceLinkCreate={0}", context.LinkSources.ToString().ToLower()), + .Append("/p:Version={0}", context.Version.GetSemanticVersion()), }); } } diff --git a/build/Tasks/Default.cs b/build/Tasks/Default.cs index e69c10e224..00c548f5b3 100644 --- a/build/Tasks/Default.cs +++ b/build/Tasks/Default.cs @@ -1,6 +1,4 @@ using Cake.Frosting; - -[IsDependentOn(typeof(TestSourceLink))] public sealed class Default : FrostingTask { } diff --git a/build/Tasks/TestSourceLink.cs b/build/Tasks/TestSourceLink.cs deleted file mode 100644 index 003c617be5..0000000000 --- a/build/Tasks/TestSourceLink.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Cake.Common; -using Cake.Common.Diagnostics; -using Cake.Common.IO; -using Cake.Core; -using Cake.Core.IO; -using Cake.Frosting; - -[IsDependentOn(typeof(Package))] -public class TestSourceLink : FrostingTask -{ - public override void Run(Context context) - { - var nugetPackages = context.GetFiles($"./{context.Artifacts}/*.nupkg"); - - foreach (var nugetPackage in nugetPackages) - { - context.Information("Testing sourcelink info in {0}", context.Environment.WorkingDirectory.GetRelativePath(nugetPackage)); - var exitCode = context.StartProcess("dotnet", new ProcessSettings - { - WorkingDirectory = "Octokit", - Arguments = $"sourcelink test {nugetPackage.FullPath}" - }); - - if (exitCode != 0) - { - throw new Exception("Sourcelink test failed!"); - } - } - } - - public override bool ShouldRun(Context context) - { - return context.LinkSources; - } -} diff --git a/docs/debugging-source.md b/docs/debugging-source.md index c0b6b6418e..b9eae6019a 100644 --- a/docs/debugging-source.md +++ b/docs/debugging-source.md @@ -22,11 +22,11 @@ with a specific type, and cache it in your local symbols cache. ![F11 step into symbol](https://cloud.githubusercontent.com/assets/359239/5389259/74600502-8149-11e4-94f7-10dc79a0573f.gif) -You can then set subsequent breakpoints inside the source code, to return to +You can then set subsequent breakpoints inside the source code, to return to in the debugging session. ### Acknowledgements -Thanks to [Cameron Taggart](http://blog.ctaggart.com/) for building the -[SourceLink](https://github.com/ctaggart/SourceLink) framework which we use -to support this behaviour. \ No newline at end of file +Thanks to previous of [Cameron Taggart](http://blog.ctaggart.com/) and the newer implementation of +[SourceLink](https://github.com/dotnet/sourcelink) which we use +to support this behaviour. diff --git a/docs/shipping-releases.md b/docs/shipping-releases.md index 3d42c742c8..be46e8f41f 100644 --- a/docs/shipping-releases.md +++ b/docs/shipping-releases.md @@ -26,7 +26,7 @@ Or can be run individually: ### Create NuGet Packages -NuGet packages are automatically generated (and SourceLinked) by the CAKE build script. +NuGet packages are automatically generated (and SourceLinked) by the csproj configration. > `.\build.ps1` The output .nupkg files will be located in the `packaging` directory. From f2dfb61324d14939f306529ac2b7b7615cbb0b75 Mon Sep 17 00:00:00 2001 From: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Date: Mon, 6 Feb 2023 21:45:51 +0000 Subject: [PATCH 2/5] cleans up appveyor --- README.md | 8 -------- build/Context.cs | 3 --- build/Lifetime.cs | 17 +---------------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/README.md b/README.md index 405c62e69e..6a1e0ce6dc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Octokit - GitHub API Client Library for .NET ![Build status](https://github.com/octokit/octokit.net/workflows/CI%20Build/badge.svg) -[![Build status](https://ci.appveyor.com/api/projects/status/cego2g42yw26th26/branch/main?svg=true)](https://ci.appveyor.com/project/github-windows/octokit-net/branch/main) [![codecov](https://codecov.io/gh/octokit/octokit.net/branch/main/graph/badge.svg)](https://codecov.io/gh/octokit/octokit.net) [![Join the chat at https://gitter.im/octokit/octokit.net](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/octokit/octokit.net?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![NuGet](https://img.shields.io/nuget/v/Octokit.svg)](https://www.nuget.org/packages/Octokit) @@ -42,13 +41,6 @@ There is also an IObservable based GitHub API client library for .NET using Reac dotnet add package Octokit.Reactive ``` - -### Beta packages ### -Unstable NuGet packages that track the `main` branch of this repository are available at -[https://ci.appveyor.com/nuget/octokit-net](https://ci.appveyor.com/nuget/octokit-net) - -In Xamarin Studio you can find this option under the project's context menu: **Add | Add Packages...***. - ## Documentation Documentation is available at http://octokitnet.readthedocs.io/en/latest/. diff --git a/build/Context.cs b/build/Context.cs index 6035d8dc9e..6812eea00f 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -16,11 +16,8 @@ public class Context : FrostingContext public bool IsLocalBuild { get; set; } public bool IsPullRequest { get; set; } public bool IsOriginalRepo { get; set; } - public bool IsTagged { get; set; } public bool IsMainBranch { get; set; } public bool ForcePublish { get; set; } - - public bool AppVeyor { get; set; } public bool GitHubActions { get; set; } public Project[] Projects { get; set; } diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 0e2d5a1ecd..2a1191e481 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -21,16 +21,8 @@ public override void Setup(Context context) context.IsLocalBuild = buildSystem.IsLocalBuild; context.GitHubActions = buildSystem.GitHubActions.IsRunningOnGitHubActions; - context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor; - context.IsTagged = IsBuildTagged(buildSystem); - if (context.AppVeyor) - { - context.IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest; - context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name); - context.IsMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildSystem.AppVeyor.Environment.Repository.Branch); - } - else if (context.GitHubActions) + if (context.GitHubActions) { context.IsPullRequest = buildSystem.GitHubActions.Environment.PullRequest.IsPullRequest; context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.GitHubActions.Environment.Workflow.Repository); @@ -62,16 +54,9 @@ public override void Setup(Context context) context.Information("Version suffix: {0}", context.Version.Suffix); context.Information("Configuration: {0}", context.Configuration); context.Information("Target: {0}", context.Target); - context.Information("AppVeyor: {0}", context.AppVeyor); context.Information("GitHub Actions: {0}", context.GitHubActions); } - private static bool IsBuildTagged(BuildSystem buildSystem) - { - return buildSystem.AppVeyor.Environment.Repository.Tag.IsTag - && !string.IsNullOrWhiteSpace(buildSystem.AppVeyor.Environment.Repository.Tag.Name); - } - private static string GetEnvironmentValueOrArgument(Context context, string environmentVariable, string argumentName) { var arg = context.EnvironmentVariable(environmentVariable); From a4e113f1492a0c3716a2a4e0f3c85c60b9fa98ab Mon Sep 17 00:00:00 2001 From: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Date: Tue, 7 Feb 2023 05:18:08 +0000 Subject: [PATCH 3/5] updates proj with sourcelink props --- Octokit.Reactive/Octokit.Reactive.csproj | 14 +++++++------- Octokit/Octokit.csproj | 14 +++++++------- build/Tasks/Default.cs | 1 + 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index 35bae79663..601910e0f2 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -22,15 +22,15 @@ $(NoWarn);1591;1701;1702;1705 - - true + - + + + true + true - - - true - snupkg + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 654a736de9..cd61407c1b 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -22,15 +22,15 @@ $(DefineConstants);SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;SIMPLE_JSON_TYPEINFO $(NoWarn);1591;1701;1702;1705 - - true + - + + + true + true - - - true - snupkg + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/build/Tasks/Default.cs b/build/Tasks/Default.cs index 00c548f5b3..e0bebc6861 100644 --- a/build/Tasks/Default.cs +++ b/build/Tasks/Default.cs @@ -1,4 +1,5 @@ using Cake.Frosting; +[IsDependentOn(typeof(Package))] public sealed class Default : FrostingTask { } From 99d783f23e3e2eb7f7f0cee081671e6a8e9bdaa3 Mon Sep 17 00:00:00 2001 From: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Date: Tue, 7 Feb 2023 05:33:00 +0000 Subject: [PATCH 4/5] adds deterministic build check as well. --- Octokit.Reactive/Octokit.Reactive.csproj | 1 + Octokit/Octokit.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index 601910e0f2..6182847ac8 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -22,6 +22,7 @@ $(NoWarn);1591;1701;1702;1705 + true diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index cd61407c1b..a1f0c9075b 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -22,6 +22,7 @@ $(DefineConstants);SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;SIMPLE_JSON_TYPEINFO $(NoWarn);1591;1701;1702;1705 + true From d72196371cf7203f62cd1cf420d6fb16f379323b Mon Sep 17 00:00:00 2001 From: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:35:15 -0600 Subject: [PATCH 5/5] Update docs/debugging-source.md Co-authored-by: Keegan Campbell --- docs/debugging-source.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/debugging-source.md b/docs/debugging-source.md index b9eae6019a..f0ecfacbce 100644 --- a/docs/debugging-source.md +++ b/docs/debugging-source.md @@ -27,6 +27,4 @@ in the debugging session. ### Acknowledgements -Thanks to previous of [Cameron Taggart](http://blog.ctaggart.com/) and the newer implementation of -[SourceLink](https://github.com/dotnet/sourcelink) which we use -to support this behaviour. +Thanks to Cameron Taggart for the initial implementation and the .NET foundation for ongoing support of [SourceLink](https://github.com/dotnet/sourcelink) which we use to provide source debugging.