Skip to content

Commit

Permalink
Added Nuget Publish action, as well as nuget metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
pingu2k4 committed Feb 3, 2024
1 parent 6554b77 commit b264873
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/demo-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
with:
dotnet-version: |
${{ env.DOTNET_VERSION }}
7.0
8.0
- name: Publish Project
Expand All @@ -74,5 +75,5 @@ jobs:
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
FOLDER: src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot
branch: gh-pages
folder: src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot
37 changes: 37 additions & 0 deletions .github/workflows/publish-nuget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Nuget

on:
release:
types: [ published ]

env:
DOTNET_VERSION: '8.0'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_FEED: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_KEY }}

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Create Release NuGet Package
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
echo Version: $VERSION
VERSION="${VERSION:1}"
echo Clean Version: $VERSION
dotnet build --configuration Release src/PinguApps.Blazor.QRCode/PinguApps.Blazor.QRCode.csproj
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg --no-build src/PinguApps.Blazor.QRCode/PinguApps.Blazor.QRCode.csproj
- name: Push to NuGet Feed
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --api-key $NUGET_KEY --skip-duplicate
38 changes: 35 additions & 3 deletions src/PinguApps.Blazor.QRCode/PinguApps.Blazor.QRCode.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<Authors>Pingu</Authors>
<Company>PinguApps</Company>
<Copyright>Copyright 2024 (c) Matthew Parker. All rights reserved.</Copyright>

<Description>A library for Blazor to generate QR codes, targeting specifically working with static SSR</Description>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<PackageId>PinguApps.Blazor.QRCode</PackageId>
<PackageTags>Blazor;QR;QR Code;Pingu;PinguApps;Pingu Apps;Component;ASP.NET;CSharp;Web</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/PinguApps/Blazor.QRCode</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/PinguApps/Blazor.QRCode</RepositoryUrl>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>


<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.26" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.15" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.4" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Binary file added src/PinguApps.Blazor.QRCode/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b264873

Please sign in to comment.