Skip to content

Commit

Permalink
feat!: net7 support (#162)
Browse files Browse the repository at this point in the history
* feat: net7 support

* chore: update references

* chore: cleanup

* merge

* fix: condition

* chore: cleanup

* chore: cleanup

* chore: clean
  • Loading branch information
IvanJosipovic authored Nov 10, 2022
1 parent b1fa37b commit 7b8a1f4
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 74 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
on:
on:
workflow_dispatch:
push:
branches:
- '*'
branches:
- 'master'
- 'alpha'
- 'beta'
- 'dev'
pull_request:
types: [opened, reopened, synchronize]

name: Create Release
jobs:
Expand All @@ -16,7 +22,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Dotnet Build
run: dotnet build -c Release
Expand All @@ -31,22 +37,19 @@ jobs:
shell: pwsh

- name: Install Playwright
working-directory: src/BlazorApplicationInsights.Tests/bin/Release/net6.0
working-directory: src/BlazorApplicationInsights.Tests/bin/Release/net7.0
run: ./playwright.ps1 install
shell: pwsh

- name: Run Tests
working-directory: src/BlazorApplicationInsights.Tests
run: dotnet test -c Release

- name: Deploy to Production
if: github.ref == 'refs/heads/master'
uses: netlify/actions/cli@master
with:
args: deploy --prod --json -d src/BlazorApplicationInsights.Sample/bin/Release/net6.0/publish/wwwroot
- name: Deploy
run: npx netlify deploy ${{ (github.ref == 'refs/heads/alpha' && '--prod') || '' }} --json -d src/BlazorApplicationInsights.Sample/bin/Release/net7.0/publish/wwwroot
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
Expand All @@ -58,10 +61,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Dotnet Pack
if: steps.semantic.outputs.new_release_published == 'true'
- name: Dotnet Pack
working-directory: src/BlazorApplicationInsights
run: dotnet pack -c Release -p:Version=${{ steps.semantic.outputs.new_release_version }}
run: dotnet pack -c Release -p:Version=${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '0.0.1' }}

- name: Dotnet Nuget Push
if: steps.semantic.outputs.new_release_published == 'true'
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "alpha",
"prerelease": true
},
},
{
"name": "beta",
"prerelease": true
Expand Down
3 changes: 2 additions & 1 deletion BlazorApplicationInsights.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApplicationInsights.S
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0131129F-20EC-4147-9C9A-A13BE002AB11}"
ProjectSection(SolutionItems) = preProject
.releaserc.json = .releaserc.json
.github\workflows\cicd.yml = .github\workflows\cicd.yml
global.json = global.json
.github\workflows\pr.yml = .github\workflows\pr.yml
README.md = README.md
.github\renovate.json = .github\renovate.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApplicationInsights.Tests", "src\BlazorApplicationInsights.Tests\BlazorApplicationInsights.Tests.csproj", "{C7FD9039-7393-4755-830C-A194C30C8F13}"
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "7.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 0 additions & 8 deletions src/BlazorApplicationInsights.Sample/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
@inherits LayoutComponentBase

<div class="page">
<div class="sidebar">
<NavMenu />
</div>

<main>
<div class="top-row px-4">
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
</div>

<article class="content px-4">
@Body
</article>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.27.2" />
<PackageReference Include="Moq" Version="4.18.2" />
Expand Down
12 changes: 6 additions & 6 deletions src/BlazorApplicationInsights/BlazorApplicationInsights.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<Title>BlazorApplicationInsights</Title>
<PackageId>BlazorApplicationInsights</PackageId>
Expand All @@ -28,16 +28,16 @@
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.22" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.22" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
Expand Down

0 comments on commit 7b8a1f4

Please sign in to comment.