diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfc17c7..6a9eacd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup .NET 9 - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: dotnet-version: 10.0.x diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d65527f..dfad56a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,15 +6,18 @@ on: jobs: build: + permissions: + contents: read + id-token: write runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - - name: Setup .NET 9 - uses: actions/setup-dotnet@v4 + - name: Setup .NET 10 + uses: actions/setup-dotnet@v6 with: dotnet-version: 10.0.x @@ -24,5 +27,11 @@ jobs: - name: Pack run: dotnet pack -c Release --no-build --output . --version-suffix ${{github.run_number}} src/Cloudtoid.Framework/Cloudtoid.Framework.csproj + - name: NuGet login + uses: NuGet/login@v1 + id: nuget-login + with: + user: pedramr + - name: Push - run: dotnet nuget push Cloudtoid.Framework.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.nuget_org_api_key }} + run: dotnet nuget push Cloudtoid.Framework.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} diff --git a/PACKAGE_README.md b/PACKAGE_README.md new file mode 100644 index 0000000..d3b1c3a --- /dev/null +++ b/PACKAGE_README.md @@ -0,0 +1,37 @@ +# Cloudtoid.Framework + +Utilities for .NET applications and libraries: asynchronous initialization, cancellation and task helpers, argument validation, collection extensions, and configuration helpers. + +## Install + +Requires .NET 10 or later. + +```sh +dotnet add package Cloudtoid.Framework +``` + +## Example: initialize a value on first use + +```csharp +using Cloudtoid; + +var settings = new AsyncLazy( + () => File.ReadAllTextAsync("settings.json")); + +string contents = await settings; +``` + +`AsyncLazy` starts initialization when the value is first requested and shares the resulting task with subsequent callers. + +## Included utilities + +- Task timeout, cancellation, and fault-logging helpers. +- `Contract` argument and state checks. +- `ReadOnlyValueList` and collection extensions. +- String, path, HTTP, and hash helpers. +- Configuration and dependency-injection extensions. +- Date/time and GUID provider interfaces for tests. + +The package also includes build configuration for Cloudtoid's banned API list. + +[API source and examples](https://github.com/cloudtoid/framework) · [Report an issue](https://github.com/cloudtoid/framework/issues) · [MIT license](https://github.com/cloudtoid/framework/blob/master/LICENSE) diff --git a/src/Cloudtoid.Framework/Cloudtoid.Framework.csproj b/src/Cloudtoid.Framework/Cloudtoid.Framework.csproj index f94cb08..fa06239 100644 --- a/src/Cloudtoid.Framework/Cloudtoid.Framework.csproj +++ b/src/Cloudtoid.Framework/Cloudtoid.Framework.csproj @@ -2,6 +2,7 @@ + PACKAGE_README.md Cloudtoid.Framework Cloudtoid.Framework pedram@rezaei.us @@ -27,4 +28,8 @@ + + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 854cd47..e5a4c60 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -30,7 +30,7 @@ - 1.0.24 + 1.0.28 5.6.0