Skip to content

Commit f10365a

Browse files
committed
Update release.yml
1 parent af4ddfc commit f10365a

File tree

1 file changed

+43
-52
lines changed

1 file changed

+43
-52
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,48 @@
11
name: Publish Packages
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*' # Match version tags like v1.0.0
4+
push:
5+
tags:
6+
- 'v*.*.*' # Match version tags like v1.0.0
77

88
jobs:
9-
test:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v3
15-
16-
- name: Setup .NET
17-
uses: actions/setup-dotnet@v3
18-
with:
19-
dotnet-version: '9.x' # Adjust the version as needed
20-
21-
- name: Install dependencies
22-
run: dotnet restore
23-
24-
- name: Build the solution
25-
run: dotnet build --no-restore
26-
27-
# Ensure that the tests must pass
28-
# The job will fail automatically if any test fails because `dotnet test` exits with a non-zero code
29-
- name: Run tests
30-
run: dotnet test --no-build --verbosity normal
31-
32-
publish:
33-
34-
runs-on: ubuntu-latest
35-
36-
needs: test
37-
38-
steps:
39-
- name: Checkout repository
40-
uses: actions/checkout@v3
41-
42-
- name: Setup .NET
43-
uses: actions/setup-dotnet@v3
44-
with:
45-
dotnet-version: '9.x'
46-
47-
- name: Restore dependencies
48-
run: dotnet restore DependencyInjection.sln
49-
50-
- name: Build
51-
run: dotnet build DependencyInjection.sln --configuration Release --no-restore
52-
53-
- name: Publish to NuGet
54-
env:
55-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
56-
run: |
57-
dotnet nuget push src/TEMPLATE/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: '9.x'
19+
20+
- name: Restore dependencies
21+
run: dotnet restore CodeOfChaos.Extensions.sln
22+
23+
- name: Build
24+
run: dotnet build CodeOfChaos.Extensions.sln --configuration Release --no-restore
25+
26+
# Ensure that the tests must pass
27+
# The job will fail automatically if any test fails because `dotnet test` exits with a non-zero code
28+
- name: Run tests - Extensions
29+
run: dotnet run -c Release --no-restore --no-build
30+
working-directory: "tests/Tests.CodeOfChaos.Extensions"
31+
- name: Run tests - Extensions.AspNetCore
32+
run: dotnet run -c Release --no-restore --no-build
33+
working-directory: "tests/Tests.CodeOfChaos.Extensions.AspNetCore"
34+
- name: Run tests - Extensions.EntityFrameworkCore
35+
run: dotnet run -c Release --no-restore --no-build
36+
working-directory: "tests/Tests.CodeOfChaos.Extensions.EntityFrameworkCore"
37+
- name: Run tests - Extensions.Serilog
38+
run: dotnet run -c Release --no-restore --no-build
39+
working-directory: "tests/Tests.CodeOfChaos.Extensions.Serilog"
40+
41+
- name: Publish to NuGet
42+
env:
43+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
44+
run: |
45+
dotnet nuget push src/CodeOfChaos.Extensions/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
46+
dotnet nuget push src/CodeOfChaos.Extensions.AspNetCore/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
47+
dotnet nuget push src/CodeOfChaos.Extensions.EntityFrameworkCore/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
48+
dotnet nuget push src/CodeOfChaos.Extensions.Serilog/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)