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
33 changes: 12 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,33 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: "5.8.0"
versionSpec: "6.4.0"

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.15
uses: gittools/actions/gitversion/execute@v4
with:
useConfigFile: true
configFilePath: "GitVersion.yml"

# Cache packages for faster subsequent runs
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'nuget.config') }}
restore-keys: |
${{ runner.os }}-nuget-

Expand All @@ -53,30 +52,22 @@ jobs:

- name: Test
working-directory: ./src
run: dotnet test --no-build -c Release -f net8.0 -l 'trx;LogFileName=results.trx' ./CenterEdge.Async.sln

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: src/**/results.trx
reporter: dotnet-trx
run: dotnet test --no-build -c Release -f net8.0 -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" ./CenterEdge.Async.sln

- name: Pack
working-directory: ./src
run: dotnet pack --no-build -c Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }} ./CenterEdge.Async.sln
run: dotnet pack --no-build -c Release /p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }} ./CenterEdge.Async.sln

- name: Push
working-directory: ./src
# Publish CI packages from PRs and tagged releases
if: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/pull/') }}
run: |
dotnet nuget add source --name github https://nuget.pkg.github.com/CenterEdge/index.json &&
dotnet nuget push **/*.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s github
dotnet nuget push **/*.${{ steps.gitversion.outputs.fullSemVer }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s github

- name: Push to NuGet.org
working-directory: ./src
# Publish tagged releases to NuGet.org
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: dotnet nuget push **/*.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s nuget.org
run: dotnet nuget push **/*.${{ steps.gitversion.outputs.fullSemVer }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s nuget.org
4 changes: 2 additions & 2 deletions .github/workflows/cleanup-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
packages: write

steps:
- uses: actions/delete-package-versions@v4
- uses: actions/delete-package-versions@v5
with:
package-name: CenterEdge.Async
package-type: nuget
min-versions-to-keep: 30
ignore-versions: ^(?!.*ci-pr).*$
ignore-versions: ^(?!.*PullRequest).*$
11 changes: 1 addition & 10 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
mode: ContinuousDelivery
branches:
pull-request:
mode: ContinuousDeployment
tag: ci-pr-
track-merge-target: true
ignore:
sha: []
merge-message-formats: {}
tag-prefix: ""
workflow: GitHubFlow/v1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -13,8 +13,8 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.11" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CenterEdge.Async\CenterEdge.Async.csproj" />
Expand Down
Loading