Skip to content

Commit 6be80d8

Browse files
authored
#2343 Release 24.1 Beta.1 (#2348)
* The PDF document should display the release version number on the cover page * Add PowerShell version of docs bulding script aka make.ps1 * Clear all cache items once a PR is closed * minimal verbosity when releasing * build.cake Version should be SemVer to release alpha, beta * build.cake CreateReleaseNotes task: add Honoring and Starring sections to the end of the release notes, which will be published in GitHub Releases and shared with the community via email * build.cake UnitTests task: single TFM for testing when releasing * build.cake UnitTests task: Don't skip unit testing just because coverage file is required for Coveralls step. Thus main branch Coveralls badge will be updated * build.cake PublishGitHubRelease task: Complete release as latest one for main branch (not a beta versions) * build.cake PublishToNuget task: SkipDuplicate if package exists on NuGet * build.cake PublishToNuget task: Publish all packs, no skipping & including filters
1 parent 2f317b7 commit 6be80d8

File tree

5 files changed

+69
-44
lines changed

5 files changed

+69
-44
lines changed

.github/workflows/pr-closed.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ jobs:
1515
run: |
1616
pr_no="${{ github.event.pull_request.number }}"
1717
echo Pull request $pr_no cache items to be deleted...
18-
gh cache list --ref refs/pull/$pr_no/merge
18+
gh cache list --ref refs/pull/$pr_no/merge
1919
echo --------------------------------------
20-
gh cache list --ref refs/pull/$pr_no/merge --json id --jq '.[].id' | xargs -n1 gh cache delete
20+
echo All cache items to be deleted...
21+
gh cache list
22+
echo --------------------------------------
23+
# gh cache list --ref refs/pull/$pr_no/merge --json id --jq '.[].id' | xargs -n1 gh cache delete
24+
# Sometimes, items produced by other workflows get reused in the PR workflow
25+
gh cache delete --all --succeed-on-no-caches
2126
echo DONE
22-
# To be added

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ jobs:
3535
- name: Build
3636
run: dotnet build --no-restore ./Ocelot.Release.sln --framework net${{ matrix.dotnet-version }}.0
3737
- name: Unit Tests
38-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
38+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
3939
- name: Acceptance Tests
40-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
40+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
4141

4242
build-macos:
4343
needs: build-windows
@@ -74,9 +74,9 @@ jobs:
7474
- name: Build
7575
run: dotnet build --no-restore ./Ocelot.Release.sln --framework net${{ matrix.dotnet-version }}.0
7676
- name: Unit Tests
77-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
77+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
7878
- name: Acceptance Tests
79-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
79+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
8080

8181
build-linux:
8282
needs: build-macos
@@ -117,9 +117,9 @@ jobs:
117117
- name: Build
118118
run: dotnet build --no-restore ./Ocelot.Release.sln --framework net${{ matrix.dotnet-version }}.0
119119
- name: Unit Tests
120-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
120+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
121121
- name: Acceptance Tests
122-
run: dotnet test --no-restore --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
122+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }}.0 ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
123123

124124
release-cake:
125125
needs: build-linux
@@ -132,7 +132,7 @@ jobs:
132132
env:
133133
# CAKE_RELEASE_MYVAR: ${{ vars.CAKE_RELEASE_MYVAR }}
134134
# TEMP_KEY: ${{ secrets.TEMP_KEY }} # leaked secret LoL
135-
GITHUB_CONTEXT: ${{ toJson(github) }} # see line 142
135+
GITHUB_CONTEXT: ${{ toJson(github) }}
136136
run: |
137137
echo "github context >>>" # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context
138138
echo "$GITHUB_CONTEXT"

build.cake

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ Task("Version")
151151
.Does(() =>
152152
{
153153
versioning = GetNuGetVersionForCommit();
154-
versioning.NuGetVersion ??= (target == Release && IsRunningInCICD())
155-
? versioning.MajorMinorPatch : versioning.SemVer;
154+
versioning.NuGetVersion ??= (target == Release && IsRunningInCICD()) ? versioning.MajorMinorPatch : versioning.SemVer;
155+
versioning.NuGetVersion = versioning.SemVer;
156156
Information("#########################");
157157
Information("# SemVer Information");
158158
Information("#========================");
@@ -412,20 +412,20 @@ Task("CreateReleaseNotes")
412412
}
413413
return log;
414414
} // END of IterateCommits
415-
// releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
416-
// releaseNotes.AddRange(topContributors.Take(3)); // Top 3 only, disabled 'breaker' logic
417-
// releaseNotes.Add("");
418-
// releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:");
419-
// releaseNotes.AddRange(starring);
420-
// releaseNotes.Add("");
421-
// releaseNotes.Add($"### Features in Release {releaseVersion}");
422-
// releaseNotes.Add("");
423-
// releaseNotes.Add("<details><summary>Logbook</summary>");
424-
// releaseNotes.Add("");
425-
// var commitsHistory = GitHelper($"log --no-merges --date=format:\"%A, %B %d at %H:%M\" --pretty=format:\"- <sub>%h by **%aN** on %ad &rarr;</sub>%n %s\" {lastRelease}..HEAD");
426-
// releaseNotes.AddRange(commitsHistory);
427-
// releaseNotes.Add("</details>");
428-
//releaseNotes.Add("");
415+
releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
416+
releaseNotes.AddRange(topContributors.Take(3)); // Top 3 only, disabled 'breaker' logic
417+
releaseNotes.Add("");
418+
releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:");
419+
releaseNotes.AddRange(starring);
420+
releaseNotes.Add("");
421+
releaseNotes.Add($"### Features in Release {releaseVersion}");
422+
releaseNotes.Add("");
423+
releaseNotes.Add("<details><summary>Logbook</summary>");
424+
releaseNotes.Add("");
425+
var commitsHistory = GitHelper($"log --no-merges --date=format:\"%A, %B %d at %H:%M\" --pretty=format:\"- <sub>%h by **%aN** on %ad &rarr;</sub>%n %s\" {lastRelease}..HEAD");
426+
releaseNotes.AddRange(commitsHistory);
427+
releaseNotes.Add("</details>");
428+
releaseNotes.Add("");
429429
WriteReleaseNotes();
430430
});
431431

@@ -496,7 +496,7 @@ private void WriteReleaseNotes()
496496
private List<string> GetTFMs()
497497
{
498498
var tfms = AllFrameworks.Split(';').ToList();
499-
if (target == "LatestFramework" || target == "UnitTests")
499+
if (target == "LatestFramework" || target == "UnitTests" || target == "Release")
500500
{
501501
tfms.Clear();
502502
tfms.Add(LatestFramework);
@@ -508,12 +508,7 @@ Task("UnitTests")
508508
.Does(() =>
509509
{
510510
var verbosity = IsRunningInCICD() ? "minimal" : "normal";
511-
if (IsRunningInCICD() && target == Release)
512-
{
513-
Warning("We are rolling out a release through the CI/CD pipeline, so we won't be running unit tests this time!");
514-
return;
515-
}
516-
// Sequential processing as an emulation of Visual Studio Test Explorer
511+
// Sequential processing as an emulation of Visual Studio Test Explorer
517512
foreach (string tfm in GetTFMs())
518513
{
519514
var settings = new DotNetTestSettings
@@ -796,7 +791,7 @@ private void PersistVersion(string committedVersion, string newVersion)
796791
}
797792
}
798793

799-
/// Publishes code and symbols packages to nuget feed, based on contents of artifacts file
794+
// Publishes code and symbols packages to nuget feed, based on contents of artifacts file
800795
private void PublishPackages(ConvertableDirectoryPath packagesDir, ConvertableFilePath artifactsFile, string feedApiKey, string codeFeedUrl, string symbolFeedUrl)
801796
{
802797
Information($"{nameof(PublishPackages)}: Publishing to NuGet...");
@@ -822,17 +817,17 @@ private void PublishPackages(ConvertableDirectoryPath packagesDir, ConvertableFi
822817
var errors = new List<string>();
823818
foreach (var artifact in artifacts)
824819
{
825-
// if (skippable.Exists(x => artifact.StartsWith(x)))
820+
// if (skippable.Exists(x => artifact.StartsWith(x)))
821+
// continue;
822+
// if (!includedInTheRelease.Exists(x => artifact.StartsWith(x)))
826823
// continue;
827-
if (!includedInTheRelease.Exists(x => artifact.StartsWith(x)))
828-
continue;
829824

830825
var codePackage = packagesDir + File(artifact);
831826
Information($"{nameof(PublishPackages)}: Pushing package " + codePackage + "...");
832827
try
833828
{
834829
DotNetNuGetPush(codePackage,
835-
new DotNetNuGetPushSettings { ApiKey = feedApiKey, Source = codeFeedUrl });
830+
new DotNetNuGetPushSettings { ApiKey = feedApiKey, Source = codeFeedUrl, SkipDuplicate = true });
836831
}
837832
catch (Exception e)
838833
{
@@ -916,8 +911,8 @@ private void CompleteGitHubRelease(dynamic release)
916911
int releaseId = release.id;
917912
string url = release.url.ToString();
918913
string body = ReleaseNotesAsJson();
919-
bool IsPreRelease = true;
920-
var json = $"{{ \"tag_name\": \"{versioning.NuGetVersion}\", \"target_commitish\": \"{versioning.BranchName}\", \"name\": \"{versioning.NuGetVersion}\", \"body\": \"{body}\", \"draft\": false, \"prerelease\": {IsPreRelease.ToString().ToLower()} }}";
914+
bool isPreRelease = !IsMainBranch();
915+
var json = $"{{ \"tag_name\": \"{versioning.NuGetVersion}\", \"target_commitish\": \"{versioning.BranchName}\", \"name\": \"{versioning.NuGetVersion}\", \"body\": \"{body}\", \"draft\": false, \"prerelease\": {isPreRelease.ToString().ToLower()} }}";
921916
var request = new System.Net.Http.HttpRequestMessage(new System.Net.Http.HttpMethod("Patch"), url); // $"https://api.github.com/repos/ThreeMammals/Ocelot/releases/{releaseId}");
922917
request.Content = new System.Net.Http.StringContent(json, System.Text.Encoding.UTF8, "application/json");
923918

@@ -964,10 +959,10 @@ private bool IsRunningOnCircleCI()
964959
private bool IsRunningInGitHubActions()
965960
=> Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
966961

967-
private bool IsMainOrDevelop()
962+
private bool IsMainBranch()
968963
{
969964
var br = GetBranchName().ToLower();
970-
return br == "main" || br == "develop";
965+
return br == "main";
971966
}
972967
private string GetBranchName()
973968
{

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
project = 'Ocelot Gateway'
1010
copyright = ' 2016-2025 Three Mammals'
1111
author = 'Tom Gardham-Pallister, Raman Maksimchuk'
12-
release = '"Globality"'
13-
version = '24.1'
12+
release = '24.1 "Globality"' # OK displayed
13+
version = '24.1' # version is not displayed in either HTML pages or PDF docs
1414

1515
# -- General configuration ---------------------------------------------------
1616
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/make.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Command file for Sphinx documentation
2+
# PowerShell version without env var usage
3+
4+
param (
5+
[string]$command
6+
)
7+
8+
# Define sphinx-build as a normal variable
9+
$sphinxBuild = "sphinx-build"
10+
11+
$SOURCEDIR = "."
12+
$BUILDDIR = "_build"
13+
14+
Write-Host "Doing $command ..."
15+
16+
if ([string]::IsNullOrEmpty($command)) {
17+
$status = "FAILED"
18+
Write-Host "There is no build command! Available commands: clean, html"
19+
Write-Host "See Sphinx Help below."
20+
& $sphinxBuild -M help $SOURCEDIR $BUILDDIR $SPHINXOPTS $O
21+
} else {
22+
& $sphinxBuild -M $command $SOURCEDIR $BUILDDIR $SPHINXOPTS $O
23+
$status = "DONE"
24+
}
25+
26+
Write-Host "Build $status"

0 commit comments

Comments
 (0)