From 56f4c88f4b365e89bb43175691ff9ddd9d3ace2d Mon Sep 17 00:00:00 2001 From: "Nuno \"Omega Leo\" Diogo" Date: Wed, 28 Jan 2026 14:06:57 +0000 Subject: [PATCH] Added shared library to published packages and fixed workflows --- .github/workflows/changelog.yml | 3 +++ .github/workflows/nuget-publish.yml | 24 ++++++++++++++++++ .../Program.cs | 1 + OmegaLeo.HelperLib.Documentation/CHANGELOG.md | 1 + .../Attributes/ChangelogAttribute.cs | 12 ++++++++- .../Attributes/DocumentationAttribute.cs | 24 ++++++++++++++++++ OmegaLeo.HelperLib.Shared/CHANGELOG.md | 7 ++++++ .../OmegaLeo.HelperLib.Shared.csproj | 25 +++++++++++++++++++ OmegaLeo.HelperLib.Shared/README.md | 4 +++ .../Controllers/HomeController.cs | 7 ++++++ .../Views/Shared/_Layout.cshtml | 3 +++ 11 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 OmegaLeo.HelperLib.Shared/CHANGELOG.md create mode 100644 OmegaLeo.HelperLib.Shared/README.md diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 97ae67d..f75cf36 100755 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -35,6 +35,9 @@ jobs: - name: Update OmegaLeo.HelperLib.Game Version run: sed -i "s/\(\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj" + - name: Update OmegaLeo.HelperLib.Shared Version + run: sed -i "s/\(\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj" + - name: Build Solution run: dotnet build --configuration Release diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml index cfe66aa..9c7f35e 100755 --- a/.github/workflows/nuget-publish.yml +++ b/.github/workflows/nuget-publish.yml @@ -113,3 +113,27 @@ jobs: asset_path: ./OmegaLeo.HelperLib.Documentation/bin/Release/OmegaLeo.HelperLib.Documentation.${{ github.event.release.tag_name }}.nupkg asset_name: OmegaLeo.HelperLib.Documentation.${{ github.event.release.tag_name }}.nupkg asset_content_type: application/zip + publish-shared-lib: + runs-on: ubuntu-latest + needs: [ get-release ] + steps: + - uses: actions/checkout@v2 + - name: Setup .Net Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.0.x' + - name: Update Project Version + run: sed -i "s/\(\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{ github.event.release.tag_name }}/" "./OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj" + - name: Create Nuget Package + run: dotnet pack "./OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj" -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="See https://github.com/omegaleo/OmegaLeo.HelperLib/releases/tag/${{ github.event.release.tag_name }}" + - name: Publish Nuget Package + run: dotnet nuget push ./OmegaLeo.HelperLib.Shared/bin/Release/OmegaLeo.HelperLib.Shared.${{ github.event.release.tag_name }}.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate + - name: Upload assets to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + upload_url: ${{ needs.get-release.outputs.upload_url }} + asset_path: ./OmegaLeo.HelperLib.Shared/bin/Release/OmegaLeo.HelperLib.Shared.${{ github.event.release.tag_name }}.nupkg + asset_name: OmegaLeo.HelperLib.Shared.${{ github.event.release.tag_name }}.nupkg + asset_content_type: application/zip \ No newline at end of file diff --git a/OmegaLeo.HelperLib.ChangelogHandler/Program.cs b/OmegaLeo.HelperLib.ChangelogHandler/Program.cs index 348978e..29ba424 100755 --- a/OmegaLeo.HelperLib.ChangelogHandler/Program.cs +++ b/OmegaLeo.HelperLib.ChangelogHandler/Program.cs @@ -17,6 +17,7 @@ var changelogs = new Dictionary() {Path.Join(root, "OmegaLeo.HelperLib", "CHANGELOG.md"), typeof(BenchmarkUtility).Assembly}, {Path.Join(root, "OmegaLeo.HelperLib.Game", "CHANGELOG.md"), typeof(OmegaLeo.HelperLib.Game.Models.ConsoleCommand).Assembly}, {Path.Join(root, "OmegaLeo.HelperLib.Documentation", "CHANGELOG.md"), typeof(OmegaLeo.HelperLib.Documentation.Helpers.DocumentationHelperTool).Assembly}, + {Path.Join(root, "OmegaLeo.HelperLib.Shared", "CHANGELOG.md"), typeof(OmegaLeo.HelperLib.Shared.Attributes.ChangelogAttribute).Assembly}, }; foreach (var changelog in changelogs) diff --git a/OmegaLeo.HelperLib.Documentation/CHANGELOG.md b/OmegaLeo.HelperLib.Documentation/CHANGELOG.md index 38d88e9..94ad99e 100644 --- a/OmegaLeo.HelperLib.Documentation/CHANGELOG.md +++ b/OmegaLeo.HelperLib.Documentation/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog ## Version 1.2.0 +### January 26, 2026 **OmegaLeo.HelperLib.Documentation.Helpers** - **DocumentationHelperTool**: diff --git a/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs b/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs index 59b5ea7..d8f188a 100755 --- a/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs +++ b/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs @@ -2,8 +2,18 @@ using System; namespace OmegaLeo.HelperLib.Shared.Attributes { + [Documentation(nameof(ChangelogAttribute), "Attribute to annotate classes, methods, or properties with changelog information.", + new [] + { + "Version - Changelog version", + "Description - Description of what was changed", + "Date - Date of the changes (Optional)" + }, + @"```cs +[Changelog(""1.0.0"", ""Created ChangelogAttribute to be used to register changes in the code."")] +public class ChangelogAttribute : Attribute" )] [Changelog("1.0.0", "Created ChangelogAttribute to be used to register changes in the code.")] - [Documentation(nameof(ChangelogAttribute), "Attribute to annotate classes, methods, or properties with changelog information.")] + [Changelog("1.2.1", "Created documentation for ChangelogAttribute.", "January 28, 2026")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)] public class ChangelogAttribute : Attribute { diff --git a/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs b/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs index c905fff..6d96f48 100755 --- a/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs +++ b/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs @@ -3,6 +3,30 @@ namespace OmegaLeo.HelperLib.Shared.Attributes { [System.AttributeUsage(AttributeTargets.All, AllowMultiple = false)] + [Changelog("1.2.1", "Created documentation for DocumentationAttribute.", "January 28, 2026")] + [Documentation("DocumentationAttribute", + "Attribute to annotate classes, methods, or properties with documentation information.", + new string[] + { + "title: The title of the documentation.", + "description: A brief description.", + "args: An array of argument descriptions.", + "codeExample: An optional code example." + }, + @"```csharp +[Documentation( + ""MyMethod"", + ""This method does something important."", + new string[] { ""param1: The first parameter."", ""param2: The second parameter."" }, + ""MyMethod(param1, param2);"" +)] +public void MyMethod(string param1, int param2) +{ + // Method implementation +} +``` +" + )] public class DocumentationAttribute : Attribute { public string Title; diff --git a/OmegaLeo.HelperLib.Shared/CHANGELOG.md b/OmegaLeo.HelperLib.Shared/CHANGELOG.md new file mode 100644 index 0000000..76e310d --- /dev/null +++ b/OmegaLeo.HelperLib.Shared/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog +## Version 1.0.0 + +**OmegaLeo.HelperLib.Shared.Attributes** +- **ChangelogAttribute**: + - Created ChangelogAttribute to be used to register changes in the code. + diff --git a/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj b/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj index 950961d..0c8bdd4 100644 --- a/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj +++ b/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj @@ -1,8 +1,33 @@  + + netstandard2.1 + enable + OmegaLeo.HelperLib.Shared + 1.2.0 + Omega Leo's Helper Library - Shared Components + Nuno "Omega Leo" Diogo + README.md + https://github.com/omegaleo/HelperLib + https://github.com/omegaleo/HelperLib + true + AGPL-3.0-only + csharp;dotnet; + git + true + + netstandard2.1 enable + + + Always + + + Always + + diff --git a/OmegaLeo.HelperLib.Shared/README.md b/OmegaLeo.HelperLib.Shared/README.md new file mode 100644 index 0000000..13e945e --- /dev/null +++ b/OmegaLeo.HelperLib.Shared/README.md @@ -0,0 +1,4 @@ +# Omega Leo's Helper Library - Shared Components +Lightweight utility library for C# projects. + +This library contains shared components and utilities that are used by other packages in the Omega Leo's Helper Library suite. \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs b/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs index e2dd0f7..12def41 100755 --- a/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs +++ b/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs @@ -62,6 +62,13 @@ public class HomeController : Controller "OmegaLeo.HelperLib.Documentation", true ), + ["shared"] = GenerateLibraryDocs( + typeof(OmegaLeo.HelperLib.Shared.Attributes.ChangelogAttribute).Assembly, + Path.Combine(root, "shared", "OmegaLeo.HelperLib.Shared.CHANGELOG.md"), + "Shared Library", + "Library of shared attributes and utilities used across other OmegaLeo.HelperLib packages", + "OmegaLeo.HelperLib.Shared" + ), }; _logger.LogInformation("Initialized {Count} libraries", _libraryCache.Count); diff --git a/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml b/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml index e77ff9d..5cce3cb 100755 --- a/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml +++ b/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml @@ -36,6 +36,9 @@ +