-
-
Notifications
You must be signed in to change notification settings - Fork 36
64 lines (51 loc) · 1.99 KB
/
build-release.yml
File metadata and controls
64 lines (51 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Release
on:
push:
tags:
- '*.*.*'
pull_request:
branches:
- main
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- name: Install Coverlet
run: dotnet tool install --global coverlet.console
- name: Restore
run: dotnet restore src/DispatchR/DispatchR.csproj
- name: Build
run: dotnet build src/DispatchR/DispatchR.csproj --configuration Release --no-restore
- name: Run Tests
run: dotnet test --collect:"XPlat Code Coverage"
- name: List files
run: ls -alh tests/DispatchR.IntegrationTest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Extract version from tag
id: get_version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Pack DispatchR project
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet pack src/DispatchR/DispatchR.csproj --configuration Release --no-build -o ./nupkgs /p:PackageVersion=${{ steps.get_version.outputs.version }}
- name: Pack DispatchR Abstractions project
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet pack src/DispatchR.Abstractions/DispatchR.Abstractions.csproj --configuration Release --no-build -o ./nupkgs /p:PackageVersion=${{ steps.get_version.outputs.version }}
- name: Push to NuGet
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json