From 57b369aee9cc68f7084d05d262489344ba499c57 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 08:54:20 -0400 Subject: [PATCH 1/7] Fix invalid call to release notes --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index b06cc8b1da..6a59b0286d 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1408,7 +1408,7 @@ jobs: run: curl -L https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml -o changelog.yml - name: Generate Release Notes - run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes ${{ env.TGS_DM_VERSION }} --nuget + run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --nuget - name: Publish Tgstation.Server.Common to NuGet uses: alirezanet/publish-nuget@e276c40afeb2a154046f0997820f2a9ea74832d9 # v3.1.0 From 268dcabbff89bbb8780cea8b97f1cd7b6a6c206d Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 09:17:42 -0400 Subject: [PATCH 2/7] Fix changelog.yml being removed by CI --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 6a59b0286d..1a3148db03 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -213,10 +213,10 @@ jobs: - name: gh-pages Push if: github.event_name == 'push' && github.event.ref == 'refs/heads/dev' && env.TGS_RELEASE_NOTES_TOKEN != '' run: | - sudo mv changelog.yml $HOME/tgsdox/ pushd $HOME/tgsdox rm -r * popd + sudo mv changelog.yml $HOME/tgsdox/ echo ./doxout/* | xargs -n 10 sudo mv -t $HOME/tgsdox cd $HOME/tgsdox git config --global push.default simple From b1e9a21dc213942116664ff48cbd2c3c0f9781c9 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 18:26:35 -0400 Subject: [PATCH 3/7] Release Notes fixes - Do not use markdown with Nuget release notes. - Force asserts to evaluate as they were breaking the `TGSDeploy` notes --- .../Tgstation.Server.ReleaseNotes/Program.cs | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/tools/Tgstation.Server.ReleaseNotes/Program.cs b/tools/Tgstation.Server.ReleaseNotes/Program.cs index 978e5276bc..bc3ce94d6b 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Program.cs +++ b/tools/Tgstation.Server.ReleaseNotes/Program.cs @@ -661,7 +661,7 @@ async Task CommitNotes(Component component, List notes) if (changelists.TryGetValue(component, out var currentChangelist)) currentChangelist.Changes.AddRange(tupleSelector); else - Debug.Assert(changelists.TryAdd(component, new Changelist + DebugAssert(changelists.TryAdd(component, new Changelist { Changes = tupleSelector.ToList(), Unreleased = false, @@ -725,7 +725,7 @@ async Task CommitNotes(Component component, List notes) await previousTask; - Debug.Assert(!(await needExtendedComponentVersions) || changelists.Where(x => x.Key == Component.Core).All(x => x.Value.ComponentVersions != null && x.Value.ComponentVersions.Count > 3)); + DebugAssert(!(await needExtendedComponentVersions) || changelists.Where(x => x.Key == Component.Core).All(x => x.Value.ComponentVersions != null && x.Value.ComponentVersions.Count > 3)); return Tuple.Create(changelists.ToDictionary(kvp => kvp.Key, kvp => kvp.Value), await componentVersions, isReleasePR); } @@ -987,7 +987,7 @@ async Task RunPRs() newList = newList.OrderBy(x => x).ToList(); var index = newList.IndexOf(componentVersion); - Debug.Assert(index != -1); + DebugAssert(index != -1); if (index != (newList.Count - 1)) { componentVersion = newList[index + 1]; @@ -1013,10 +1013,10 @@ async Task RunPRs() entry.Changes.AddRange(changelist.Changes); } - Debug.Assert(list.Select(x => x.Version.ToString()).Distinct().Count() == list.Count); + DebugAssert(list.Select(x => x.Version.ToString()).Distinct().Count() == list.Count); if (component == Component.Core) { - Debug.Assert(list.All(x => x.Version == milestoneVersion)); + DebugAssert(list.All(x => x.Version == milestoneVersion)); } list = list.OrderByDescending(x => x.Version).ToList(); @@ -1038,7 +1038,7 @@ async Task RunPRs() }); } else - Debug.Assert(finalResults[Component.Core].All(x => x.Version == milestoneVersion && x.ComponentVersions != null && x.ComponentVersions.Count > 3)); + DebugAssert(finalResults[Component.Core].All(x => x.Version == milestoneVersion && x.ComponentVersions != null && x.ComponentVersions.Count > 3)); var notes = new ReleaseNotes { @@ -1189,7 +1189,7 @@ static async Task GenerateNotes(IGitHubClient client, Dictionary x.Key == Component.Core) .ToList(); - Debug.Assert( + DebugAssert( coreCls.Count == milestonesToProcess.Count); var distinctCoreVersions = coreCls @@ -1204,7 +1204,7 @@ static async Task GenerateNotes(IGitHubClient client, Dictionary !distinctCoreVersions.Any(y => Version.Parse(x.Title.AsSpan(1)) == y)) .ToList(); - Debug.Assert(missingCoreVersions.Count == 0); + DebugAssert(missingCoreVersions.Count == 0); var changelistsGroupedByComponent = milestonePRTasks @@ -1236,7 +1236,7 @@ static async Task GenerateNotes(IGitHubClient client, Dictionary GenerateNotes(IGitHubClient client, Dictionary changelist.Version.ToString()).Distinct().Count(); - Debug.Assert(distinctCount == kvp.Value.Count); + DebugAssert(distinctCount == kvp.Value.Count); foreach (var cl in kvp.Value) { @@ -1313,11 +1313,14 @@ static void PrintChanges(StringBuilder newNotes, Changelist changelist, bool deb throw new Exception($"Changlist {changelist.Version} has no changes!"); } - static string GenerateComponentNotes(ReleaseNotes releaseNotes, Component component, Version version) + static string GenerateComponentNotes(ReleaseNotes releaseNotes, Component component, Version version, bool useMarkdown) { var relevantChangelog = releaseNotes.Components[component].FirstOrDefault(x => x.Version == version); - var newNotes = new StringBuilder("Full changelog can be found [here](https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml)."); + var newNotes = new StringBuilder( + useMarkdown + ? "Full changelog can be found [here](https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml)." + : "Full changelog can be found here: https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml."); if (relevantChangelog != null) { newNotes.AppendLine(); @@ -1331,7 +1334,7 @@ static string GenerateComponentNotes(ReleaseNotes releaseNotes, Component compon static async Task ReleaseComponent(IGitHubClient client, Version version, Component component) { var releaseNotes = await GenerateNotes(client, new Dictionary { { component, version } }); - await File.WriteAllTextAsync(OutputPath, GenerateComponentNotes(releaseNotes, component, version)); + await File.WriteAllTextAsync(OutputPath, GenerateComponentNotes(releaseNotes, component, version, true)); return 0; } @@ -1373,7 +1376,7 @@ static async Task ReleaseNuget(IGitHubClient client) var component = kvp.Key; var csprojPath = CsprojSubstitution.Replace("$PROJECT$", kvp.Value); - var markdown = GenerateComponentNotes(releaseNotes, component, componentVersions[component]); + var markdown = GenerateComponentNotes(releaseNotes, component, componentVersions[component], false); var escapedMarkdown = SecurityElement.Escape(markdown); @@ -1557,5 +1560,15 @@ static async Task GenDebianChangelog(IGitHubClient client, Version version, await File.WriteAllTextAsync(outputPath, changelog); return 0; } + + static void DebugAssert(bool condition, string message = null) + { + // This exists because one of the fucking asserts evaluates an enumerable or something and it was getting optimized out in release + // I CBA to track this down. + if (message != null) + Debug.Assert(condition, message); + else + Debug.Assert(condition); + } } } From bdc6876734461681036a214ba290ec1af9f25bfa Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 19:35:04 -0400 Subject: [PATCH 4/7] Fix nuget copyright, setup source link --- build/NugetCommon.props | 12 +++++++++++- build/Version.props | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/build/NugetCommon.props b/build/NugetCommon.props index 6f2600ccd3..cf733e1214 100644 --- a/build/NugetCommon.props +++ b/build/NugetCommon.props @@ -5,18 +5,28 @@ true Jordan Dominion /tg/station 13 + true + true https://tgstation.github.io/tgstation-server LICENSE README.md tgs.png Git https://github.com/tgstation/tgstation-server - 2018-2023 + Copyright (c) Jordan Brown 2018 true snupkg enable + + true + + + + + + diff --git a/build/Version.props b/build/Version.props index dd1424410f..d8e38c66b0 100644 --- a/build/Version.props +++ b/build/Version.props @@ -6,9 +6,9 @@ 5.14.0 4.7.1 9.12.0 - 6.0.0 - 11.1.0 - 12.1.0 + 6.0.1 + 11.1.1 + 12.1.1 6.5.2 5.6.1 1.4.0 From 0b3f9fe5a508179339f97427c4d5ec562165be01 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 19:46:08 -0400 Subject: [PATCH 5/7] Add usage comment to `Microsoft.SourceLink.GitHub` --- build/NugetCommon.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/NugetCommon.props b/build/NugetCommon.props index cf733e1214..23e6a4d258 100644 --- a/build/NugetCommon.props +++ b/build/NugetCommon.props @@ -24,7 +24,8 @@ - + + From dcf5a3b2a1c41877c8def0a42144b805e6981695 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 20:09:28 -0400 Subject: [PATCH 6/7] Final round of Nuget package updates - Update to SourceLink Byond.TopicSender version --- src/Tgstation.Server.Host/Tgstation.Server.Host.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index dc49c33df0..e979588d4c 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -63,7 +63,7 @@ - + @@ -121,7 +121,7 @@ - + From ccc7c8cbca82f8f5fc4fb5d741c1aee1ed14a9ff Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 22 Aug 2023 20:53:29 -0400 Subject: [PATCH 7/7] Portable pdbs are necessary for SourceLink Mirroring fc007543dbfa888cd274e5a54a512e830641fd1b here --- build/Common.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Common.props b/build/Common.props index c081f2e0d7..40e797c169 100644 --- a/build/Common.props +++ b/build/Common.props @@ -4,6 +4,7 @@ net$(TgsNetMajorVersion).0 latest - Full + +