Skip to content

Commit

Permalink
Update target frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jan 29, 2024
1 parent 989e96e commit ff4623b
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 66 deletions.
44 changes: 24 additions & 20 deletions .github/workflows/dotnet-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ name: Dotnet Package

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
dotnet: [6, 7, 8]

steps:
- uses: actions/checkout@v4
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: dotnet restore XtermBlazor
- name: Build
run: dotnet build XtermBlazor --no-restore
#- name: Test
# run: dotnet test XtermBlazor --no-build --verbosity normal
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: dotnet restore XtermBlazor

- name: Build
run: dotnet build XtermBlazor --no-restore

# - name: Test
# run: dotnet test XtermBlazor --no-build --verbosity normal
42 changes: 23 additions & 19 deletions .github/workflows/dotnet-publish-gpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
source-url: https://nuget.pkg.github.com/BattlefieldDuck/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Build
run: dotnet build XtermBlazor -c Release
- name: Create the package
run: dotnet pack XtermBlazor -c Release
- name: Publish the package to GPR
run: dotnet nuget push XtermBlazor/bin/Release/*.nupkg
- uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8
source-url: https://nuget.pkg.github.com/BattlefieldDuck/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Build
run: dotnet build XtermBlazor -c Release

- name: Create the package
run: dotnet pack XtermBlazor -c Release

- name: Publish the package to GPR
run: dotnet nuget push XtermBlazor/bin/Release/*.nupkg
40 changes: 22 additions & 18 deletions .github/workflows/dotnet-publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Build
run: dotnet build XtermBlazor -c Release
- name: Create the package
run: dotnet pack XtermBlazor -c Release
- name: Publish the package to nuget.org
run: dotnet nuget push XtermBlazor/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
- uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Build
run: dotnet build XtermBlazor -c Release

- name: Create the package
run: dotnet pack XtermBlazor -c Release

- name: Publish the package to nuget.org
run: dotnet nuget push XtermBlazor/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
28 changes: 19 additions & 9 deletions XtermBlazor/XtermBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
Expand Down Expand Up @@ -32,11 +32,11 @@
<ItemGroup>
<WebpackInputs Remove="webpack.config.ts" />
</ItemGroup>

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

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
Expand All @@ -51,12 +51,22 @@
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.15" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.26" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.15" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<Content Update="package-lock.json">
<Pack>False</Pack>
Expand All @@ -80,5 +90,5 @@
<Target Name="RunWebpack" AfterTargets="ResolveReferences" Inputs="@(WebpackInputs)" Outputs="wwwroot\XtermBlazor.min.js" DependsOnTargets="EnsureNpmRestored">
<Exec Command="npm run build" />
</Target>

</Project>

0 comments on commit ff4623b

Please sign in to comment.