Skip to content

Commit 1db6cd5

Browse files
committed
Publish Package workflow
1 parent 2abe1ad commit 1db6cd5

File tree

4 files changed

+81
-29
lines changed

4 files changed

+81
-29
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-reportgenerator-globaltool": {
6+
"version": "5.4.7",
7+
"commands": [
8+
"reportgenerator"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/dotnet.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Publishes beta-versions only
2+
name: Publish Package
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
dotnet-version: [ '8.0', '9.0' ]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Setup .NET ${{ matrix.dotnet-version }}
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: ${{ matrix.dotnet-version }}.x
20+
- name: .NET Info
21+
run: dotnet --info
22+
- name: Restore
23+
run: dotnet restore ./Ocelot.Administration.IdentityServer4.sln -p:TargetFramework=net${{ matrix.dotnet-version }}
24+
- name: Build
25+
run: dotnet build --no-restore ./Ocelot.Administration.IdentityServer4.sln --framework net${{ matrix.dotnet-version }}
26+
- name: Unit Tests
27+
run: dotnet test --no-restore --no-build --collect:"XPlat Code Coverage" --framework net${{ matrix.dotnet-version }} ./unit/Ocelot.Administration.IdentityServer4.UnitTests.csproj
28+
- name: Acceptance Tests
29+
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }} ./acceptance/Ocelot.Administration.IdentityServer4.AcceptanceTests.csproj
30+
- name: Report generator
31+
run: |
32+
dotnet tool restore
33+
dotnet tool run reportgenerator
34+
35+
# build2:
36+
# runs-on: ubuntu-latest
37+
# permissions:
38+
# packages: write
39+
# contents: read
40+
# steps:
41+
# - name: Checkout repository
42+
# uses: actions/checkout@v4
43+
44+
# - name: Setup .NET
45+
# uses: actions/setup-dotnet@v4
46+
# with:
47+
# dotnet-version: |
48+
# 8.0.x
49+
# 9.0.x
50+
51+
# - name: .NET Info
52+
# run: dotnet --info
53+
54+
# - name: Restore dependencies
55+
# run: dotnet restore ./Ocelot.Administration.IdentityServer4.sln
56+
57+
# - name: Build project
58+
# run: dotnet build ./src/Ocelot.Testing.csproj --configuration Release --no-restore
59+
60+
# - name: Pack project
61+
# run: dotnet pack ./src/Ocelot.Testing.csproj --configuration Release --output ./packages
62+
63+
# - name: Publish to GitHub Packages
64+
# run: dotnet nuget push ./packages/*.nupkg --source "https://nuget.pkg.github.com/ThreeMammals/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
65+
66+
# - name: Publish to NuGet
67+
# run: dotnet nuget push ./packages/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY_2025 }} --skip-duplicate

unit/Ocelot.Administration.IdentityServer4.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
17+
<PackageReference Include="ReportGenerator.Core" Version="5.4.7" />
1718
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1819
<PackageReference Include="Moq" Version="4.20.72" />
1920
<PackageReference Include="xunit" Version="2.9.3" />

0 commit comments

Comments
 (0)