Skip to content

Bump the dotnet group with 15 updates #21

Bump the dotnet group with 15 updates

Bump the dotnet group with 15 updates #21

Workflow file for this run

name: CI
on:
push:
branches: [master, main, develop, "release/**", "hotfix/**", "feature/**"]
tags: ["*"]
pull_request:
branches: [master, main, develop]
permissions:
contents: read
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
CONFIGURATION: Release
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["8.0.x", "9.0.x", "10.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore
run: dotnet restore EventHorizon.sln
- name: Build
run: dotnet build EventHorizon.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test EventHorizon.sln --configuration ${{ env.CONFIGURATION }} --no-build --logger "trx;LogFileName=results.trx" --filter "Category!=Integration"
continue-on-error: false
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/hotfix/') || startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/tags/'))
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.x'
- name: Determine version
id: version
uses: gittools/actions/gitversion/execute@v4
with:
useConfigFile: true
- name: Restore
run: dotnet restore EventHorizon.sln
- name: Build
run: dotnet build EventHorizon.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Pack NuGet packages
run: |
VERSION="${{ steps.version.outputs.semVer }}"
for proj in src/EventHorizon.*/EventHorizon.*.csproj; do
ASSEMBLY_NAME=$(basename "$(dirname "$proj")")
PACKAGE_ID="${ASSEMBLY_NAME}"
echo "Packing ${PACKAGE_ID} v${VERSION}"
dotnet pack "$proj" \
--configuration ${{ env.CONFIGURATION }} \
--no-build \
--output ./artifacts \
-p:PackageId="${PACKAGE_ID}" \
-p:PackageVersion="${VERSION}" \
-p:Version="${VERSION}"
done
- name: NuGet login (trusted publishing)
uses: NuGet/login@v1
id: nuget-login
with:
user: potatman
- name: Push to NuGet.org
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Push pre-release to NuGet.org
if: startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/hotfix/') || github.ref == 'refs/heads/develop'
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./artifacts/*.nupkg
retention-days: 30