Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
380 changes: 190 additions & 190 deletions .editorconfig

Large diffs are not rendered by default.

22 changes: 7 additions & 15 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
name: Build and analyze
runs-on: windows-latest
env:
SONAR_PROJECT: 'astar-dev-utilities'
ProjectName: 'AStar.Dev.Utilities'
RepositoryName: 'astar-dev-utilities'
steps:
Expand All @@ -26,45 +27,36 @@ jobs:
with:
fetch-depth: 0

- name: Cache SonarCloud packages
- name: 🛠 Cache SonarQube Cloud packages
uses: actions/cache@v4.2.3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache SonarCloud scanner
- name: 🛠 Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4.2.3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install SonarCloud scanner
- name: 🛠 Install SonarQube Cloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner

- name: Build and analyze
- name: 🔍 Restore, 🛠 Build and 🧪 Test with ☁️ SonarCloud / Qube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
dotnet tool install --global dotnet-coverage
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.RepositoryName }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.SONAR_PROJECT }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true
dotnet build --configuration Release
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Acceptance.Tests"' -f xml -o 'coverage.xml'
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml'
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

- name: Pack NuGet package
if: github.ref == 'refs/heads/main'
run: dotnet pack .\src\${{ env.ProjectName }}\${{ env.ProjectName }}.csproj

- name: Push to NuGet
if: github.ref == 'refs/heads/main'
run: dotnet nuget push "**\${{ env.ProjectName }}.*.nupkg" --api-key ${{secrets.nuget_api_key}} --skip-duplicate --source https://api.nuget.org/v3/index.json

34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 🚀 Publish NuGet Package

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
ProjectName: 'AStar.Dev.Utilities'

steps:
- name: 🧾 Checkout code
uses: actions/checkout@v4

- name: 🛠 Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: 🔍 Restore dependencies
run: dotnet restore

- name: 🛠 Build solution
run: dotnet build --configuration Release

- name: 📦 Pack NuGet package
run: dotnet pack ./src/${{ env.ProjectName }}/${{ env.ProjectName }}.csproj --configuration Release --output ./nupkg

- name: 🚀 Publish to NuGet.org
run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NuGet_API_Key }} #

15 changes: 8 additions & 7 deletions AStar.Dev.Utilities.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{538ADD9A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{4FDD8291-A186-40FE-BB14-CA60EB3274FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities.Tests.Unit", "tests\unit\AStar.Dev.Utilities.Tests.Unit\AStar.Dev.Utilities.Tests.Unit.csproj", "{713622F6-BCF6-47AE-BBD2-45CCE257C664}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{21399C8D-85EE-4D9A-B57C-6EF16EEC03EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities", "src\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj", "{22F07837-7837-4AC9-9CBC-8906325B99A7}"
Expand All @@ -29,8 +27,11 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{4FA6EC7F-8049-496E-BBEE-7374E3FA4E70}"
ProjectSection(SolutionItems) = preProject
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities.Tests.Unit", "tests\AStar.Dev.Utilities.Tests.Unit\AStar.Dev.Utilities.Tests.Unit.csproj", "{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -40,19 +41,19 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{713622F6-BCF6-47AE-BBD2-45CCE257C664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{713622F6-BCF6-47AE-BBD2-45CCE257C664}.Debug|Any CPU.Build.0 = Debug|Any CPU
{713622F6-BCF6-47AE-BBD2-45CCE257C664}.Release|Any CPU.ActiveCfg = Release|Any CPU
{713622F6-BCF6-47AE-BBD2-45CCE257C664}.Release|Any CPU.Build.0 = Release|Any CPU
{22F07837-7837-4AC9-9CBC-8906325B99A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22F07837-7837-4AC9-9CBC-8906325B99A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22F07837-7837-4AC9-9CBC-8906325B99A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22F07837-7837-4AC9-9CBC-8906325B99A7}.Release|Any CPU.Build.0 = Release|Any CPU
{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4FDD8291-A186-40FE-BB14-CA60EB3274FF} = {538ADD9A-B30C-4385-B1B0-5EF853807ED1}
{713622F6-BCF6-47AE-BBD2-45CCE257C664} = {4FDD8291-A186-40FE-BB14-CA60EB3274FF}
{22F07837-7837-4AC9-9CBC-8906325B99A7} = {21399C8D-85EE-4D9A-B57C-6EF16EEC03EC}
{4FA6EC7F-8049-496E-BBEE-7374E3FA4E70} = {58D4DA15-FD32-449A-9DDC-048271C65846}
{D92519EC-D6B0-4F9B-B170-BED80DCC0F4C} = {4FDD8291-A186-40FE-BB14-CA60EB3274FF}
EndGlobalSection
EndGlobal
66 changes: 26 additions & 40 deletions src/AStar.Dev.Utilities/AStar.Dev.Utilities.csproj
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AnalysisLevel>latest-recommended</AnalysisLevel>
<Authors>AStar Development, Jason Barden</Authors>
<Company>AStar Development</Company>
<Copyright>AStar Development, 2025</Copyright>
<Description>A collection of useful utilities that do not fit within any of the other, more targeted, AStar NuGet packages.</Description>
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IncludeSymbols>True</IncludeSymbols>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable>
<PackageIcon>AStar.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/astar-development/astar-dev-utilities</PackageProjectUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>AStar Dev Utilities</Title>
<Company>AStar Development</Company>
<Copyright>AStar Development, 2024</Copyright>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<RepositoryUrl>https://github.com/astar-development/astar-dev-utilities.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/astar-development/astar-dev-utilities</PackageProjectUrl>
<Description>A collection of useful utilities that do not fit within any of the other, more targeted, AStar Dev NuGet packages.</Description>
<Version>1.6.2</Version>
<Authors>AStar Development, Jason Barden</Authors>
<RepositoryType>git</RepositoryType>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFramework>net9.0</TargetFramework>
<Title>AStar Dev Utilities</Title>
<Version>1.6.1</Version>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>
<PackageReleaseNotes>Add RemoveTrailing extension and fix bug in truncate so length specified is honoured.</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<None Include="LICENSE" Pack="true" PackagePath=""/>
<None Include="Readme.md" Pack="true" PackagePath=""/>
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<NoWarn>1701;1702;</NoWarn>
Expand All @@ -37,30 +43,10 @@
<NoWarn>1701;1702;</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\AStar.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\Readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<None Update="AStar.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AStar.Dev.Technical.Debt.Reporting" Version="0.1.0"/>
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.14"/>
</ItemGroup>

</Project>
Loading
Loading