Skip to content

Commit ca4cc51

Browse files
Tom BrewerTom Brewer
authored andcommitted
feat: nuget publish
add nuget publishing setup
1 parent a4faabe commit ca4cc51

File tree

7 files changed

+61
-17
lines changed

7 files changed

+61
-17
lines changed

.github/workflows/publish-packages.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
types: [created]
66
workflow_dispatch:
77

8-
env:
9-
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10-
NUGET_SOURCE: https://nuget.pkg.github.com/mythetech/index.json
11-
128
jobs:
139
publish:
1410
runs-on: ubuntu-latest
@@ -20,22 +16,24 @@ jobs:
2016
- name: Checkout
2117
uses: actions/checkout@v4
2218

23-
- name: Get latest .NET SDK
19+
- name: Setup .NET SDK
2420
uses: actions/setup-dotnet@v4
2521
with:
26-
dotnet-version: '9.0'
22+
dotnet-version: '10.0'
2723

28-
- name: Install .Net WASM workload
24+
- name: Install .NET WASM workload
2925
run: dotnet workload install wasm-tools
3026

31-
- name: Setup NuGet Authentication
32-
run: dotnet nuget add source --username USERNAME --password ${{ env.NUGET_AUTH_TOKEN }} --store-password-in-clear-text --name github ${{ env.NUGET_SOURCE }}
33-
34-
- name: Build and Pack Components Library
27+
- name: Build and Pack
3528
run: |
3629
dotnet pack Mythetech.Components/Mythetech.Components.csproj -c Release -o ./nupkgs
3730
dotnet pack Mythetech.Components.WebAssembly/Mythetech.Components.WebAssembly.csproj -c Release -o ./nupkgs
3831
dotnet pack Mythetech.Components.Desktop/Mythetech.Components.Desktop.csproj -c Release -o ./nupkgs
3932
40-
- name: Publish Packages
41-
run: dotnet nuget push ./nupkgs/*.nupkg --source ${{ env.NUGET_SOURCE }} --api-key ${{ env.NUGET_AUTH_TOKEN }}
33+
- name: Publish to NuGet.org
34+
run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate
35+
36+
- name: Publish to GitHub Packages
37+
run: |
38+
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github https://nuget.pkg.github.com/mythetech/index.json
39+
dotnet nuget push ./nupkgs/*.nupkg --source github --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate

Mythetech.Components.Desktop/Mythetech.Components.Desktop.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<PackageTags>blazor;desktop;photino;components;ui</PackageTags>
1212
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1313
<RepositoryUrl>https://github.com/mythetech/Mythetech.Components</RepositoryUrl>
14+
<PackageProjectUrl>https://github.com/mythetech/Mythetech.Components</PackageProjectUrl>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
<PackageIcon>icon.png</PackageIcon>
1417
</PropertyGroup>
1518

1619
<ItemGroup>
@@ -21,4 +24,9 @@
2124
<ProjectReference Include="..\Mythetech.Components\Mythetech.Components.csproj" />
2225
</ItemGroup>
2326

27+
<ItemGroup>
28+
<None Include="..\README.md" Pack="true" PackagePath="\"/>
29+
<None Include="..\icon.png" Pack="true" PackagePath="\"/>
30+
</ItemGroup>
31+
2432
</Project>

Mythetech.Components.WebAssembly/Mythetech.Components.WebAssembly.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
<PackageTags>blazor;wasm;components;ui</PackageTags>
1212
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1313
<RepositoryUrl>https://github.com/mythetech/Mythetech.Components</RepositoryUrl>
14+
<PackageProjectUrl>https://github.com/mythetech/Mythetech.Components</PackageProjectUrl>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
<PackageIcon>icon.png</PackageIcon>
1417
</PropertyGroup>
1518

1619
<ItemGroup>
1720
<ProjectReference Include="..\Mythetech.Components\Mythetech.Components.csproj" />
1821
</ItemGroup>
1922

23+
<ItemGroup>
24+
<None Include="..\README.md" Pack="true" PackagePath="\"/>
25+
<None Include="..\icon.png" Pack="true" PackagePath="\"/>
26+
</ItemGroup>
27+
2028
</Project>

Mythetech.Components/Components/Progress/ProgressCountdown.razor

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,34 @@
1111
@code {
1212
private bool _disposed;
1313

14+
/// <summary>
15+
/// Duration of the countdown in milliseconds. Default is 5000 (5 seconds).
16+
/// </summary>
1417
[Parameter] public int Duration { get; set; } = 5000;
1518

19+
/// <summary>
20+
/// The color of the progress bar. Default is <see cref="MudBlazor.Color.Primary"/>.
21+
/// </summary>
1622
[Parameter] public Color Color { get; set; } = Color.Primary;
1723

24+
/// <summary>
25+
/// Whether the progress bar has rounded corners. Default is true.
26+
/// </summary>
1827
[Parameter] public bool Rounded { get; set; } = true;
1928

29+
/// <summary>
30+
/// Whether the progress bar displays a striped pattern. Default is false.
31+
/// </summary>
2032
[Parameter] public bool Striped { get; set; } = false;
2133

34+
/// <summary>
35+
/// The size of the progress bar. Default is <see cref="MudBlazor.Size.Small"/>.
36+
/// </summary>
2237
[Parameter] public Size Size { get; set; } = Size.Small;
2338

2439
private double Value { get; set; } = 100;
25-
40+
41+
/// <inheritdoc />
2642
protected override async Task OnInitializedAsync()
2743
{
2844
await base.OnInitializedAsync();
@@ -54,5 +70,6 @@
5470
StateHasChanged();
5571
}
5672

73+
/// <inheritdoc />
5774
public void Dispose() => _disposed = true;
5875
}

Mythetech.Components/Mythetech.Components.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<PackageTags>blazor;components;ui</PackageTags>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<RepositoryUrl>https://github.com/mythetech/Mythetech.Components</RepositoryUrl>
16+
<PackageProjectUrl>https://github.com/mythetech/Mythetech.Components</PackageProjectUrl>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
18+
<PackageIcon>icon.png</PackageIcon>
1619
<StaticWebAssetsEnabled>true</StaticWebAssetsEnabled>
1720
<AttachWeakETagToCompressedAssetsDuringDevelopment>true</AttachWeakETagToCompressedAssetsDuringDevelopment>
1821
</PropertyGroup>
@@ -35,4 +38,9 @@
3538
<PackageReference Include="MudBlazor" Version="8.14.0" />
3639
</ItemGroup>
3740

41+
<ItemGroup>
42+
<None Include="..\README.md" Pack="true" PackagePath="\"/>
43+
<None Include="..\icon.png" Pack="true" PackagePath="\"/>
44+
</ItemGroup>
45+
3846
</Project>

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ The WebAssembly story book is hosted on github pages here: https://mythetech.git
4343

4444
## Requirements
4545

46-
- .NET 9.0 SDK
46+
- .NET 10.0 SDK
47+
- Editor of choice
48+
- Rider (recommended)
4749
- Visual Studio 2022 or later (recommended)
50+
- VS Code with C# Dev Kit
4851

4952
## Getting Started
5053

@@ -59,14 +62,14 @@ To use these components in your Blazor application:
5962

6063
1. Add a reference to the `Mythetech.Components` project
6164
2. Add the following to your `_Imports.razor`:
65+
6266
```razor
6367
@using Mythetech.Components
6468
```
6569

6670
3. Register the services in your `Program.cs`:
6771

68-
The component library provides a lightweight message bus for commands/events
69-
72+
The component library provides a lightweight message bus for commands/events
7073

7174
```csharp
7275
builder.Services.AddMessageBus();
@@ -98,6 +101,7 @@ The project includes a comprehensive test suite. To run the tests:
98101
1. Open the solution in Visual Studio
99102
2. Use the Test Explorer to run individual tests
100103
3. Or run all tests using the command line:
104+
101105
```bash
102106
dotnet test
103107
```
@@ -108,6 +112,7 @@ The project includes a Storybook implementation for component documentation and
108112

109113
1. Navigate to the `Mythetech.Components.Storybook` directory
110114
2. Run the project:
115+
111116
```bash
112117
dotnet run
113118
```

icon.png

60.9 KB
Loading

0 commit comments

Comments
 (0)