Skip to content

Commit

Permalink
chore: reformat pipeline and project files
Browse files Browse the repository at this point in the history
  • Loading branch information
cengelha committed Apr 15, 2024
1 parent a556aeb commit 957253f
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 62 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [ master ]
create:

env:
dotnet: 8.0.x
injection: ./libNOM.io/Properties/

jobs:
test:
name: Test
Expand All @@ -20,7 +24,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: ${{ env.dotnet }}
dotnet-quality: ga
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -39,7 +43,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: ${{ env.dotnet }}
dotnet-quality: ga
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -51,29 +55,30 @@ jobs:
restore-keys: ${{ runner.os }}-nuget-
- name: Pack
run: dotnet pack libNOM.map --configuration Release
- name: Upload
- name: Upload (NuGet)
uses: actions/upload-artifact@v4
with:
name: NuGet
path: |
./.github/changelogs/
./libNOM.map/bin/Release/libNOM.map.*nupkg
path: ./libNOM.map/bin/Release/libNOM.map.*nupkg
if-no-files-found: error
- name: Upload (Release)
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged
uses: actions/upload-artifact@v4
with:
name: Release
path: ./.github/changelogs/${{ github.ref_name }}.md
if-no-files-found: error
release:
name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged
runs-on: ubuntu-latest
# Only if commit was tagged.
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [test, build]
steps:
- name: Download
uses: actions/download-artifact@v4
with:
name: NuGet
- name: Version
run: echo "nupkg_version=$((((Get-Item -Path ./libNOM.map/bin/Release/libNOM.map.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV
run: echo "nupkg_version=$((((Get-Item -Path ./NuGet/libNOM.map.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV
shell: pwsh
# Exit if version mismatch.
- name: Mismatch
if: ${{ github.ref_name != env.nupkg_version }}
run: |
Expand All @@ -82,7 +87,7 @@ jobs:
- name: Create
uses: softprops/action-gh-release@v2
with:
body_path: ./.github/changelogs/${{ github.ref_name }}.md
files: ./libNOM.map/bin/Release/libNOM.map.*nupkg
body_path: ./Release/${{ github.ref_name }}.md
files: ./NuGet/libNOM.map.*nupkg
- name: Publish
run: dotnet nuget push ./libNOM.map/bin/Release/libNOM.map.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./NuGet/libNOM.map.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
1 change: 1 addition & 0 deletions libNOM.map/libNOM.map.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PropertyGroup Label="Advanced">
<LangVersion>12.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
131 changes: 84 additions & 47 deletions libNOM.test/libNOM.test.csproj
Original file line number Diff line number Diff line change
@@ -1,51 +1,88 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Application -->
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<!-- Build -->
<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<LangVersion>12.0</LangVersion>
<Deterministic>True</Deterministic>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<IsPackable>false</IsPackable>
</PropertyGroup>

<!-- Dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\libNOM.map\libNOM.map.csproj" />
</ItemGroup>

<!-- Resources -->
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<!-- Application -->
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<!-- Global Usings -->
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<!-- Build -->
<PropertyGroup Label="General">
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Label="Publish">
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Label="Advanced">
<LangVersion>12.0</LangVersion>
<Deterministic>True</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<IsPublishable>False</IsPublishable>
</PropertyGroup>

<!-- Code Analysis -->
<PropertyGroup>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
</PropertyGroup>

<!-- Dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\libNOM.map\libNOM.map.csproj" />
</ItemGroup>

<!-- Resources -->
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>

0 comments on commit 957253f

Please sign in to comment.