Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}
37 changes: 37 additions & 0 deletions PACKAGE_README.md
Original file line number Diff line number Diff line change
@@ -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<string>(
() => File.ReadAllTextAsync("settings.json"));

string contents = await settings;
```

`AsyncLazy<T>` 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<T>` 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)
5 changes: 5 additions & 0 deletions src/Cloudtoid.Framework/Cloudtoid.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- NuGet Packaging -->
<PropertyGroup>
<PackageReadmeFile>PACKAGE_README.md</PackageReadmeFile>
<PackageId>Cloudtoid.Framework</PackageId>
<Title>Cloudtoid.Framework</Title>
<Authors>pedram@rezaei.us</Authors>
Expand All @@ -27,4 +28,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="$(MicrosoftExtensionsVersion)" />
</ItemGroup>

<ItemGroup>
<None Include="../../PACKAGE_README.md" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<!-- Code Analyzer Versions -->
<PropertyGroup>
<CloudtoidCodeAnalysisVersion>1.0.24</CloudtoidCodeAnalysisVersion>
<CloudtoidCodeAnalysisVersion>1.0.28</CloudtoidCodeAnalysisVersion>
<BannedApiAnalyzersVersion>5.6.0</BannedApiAnalyzersVersion>
</PropertyGroup>

Expand Down