-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.27 KB
/
Copy pathdotnet.yml
File metadata and controls
76 lines (62 loc) · 2.27 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
65
66
67
68
69
70
71
72
73
74
75
76
name: build
on:
push:
pull_request:
branches: [ main ]
env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
SOLUTION_DIR: 'spamfilter'
PROJECT: './spamfilter.console/spamfilter.console.csproj' # the project to publish
RELEASEPREFIX: 'spamfilter'
jobs:
build:
name: build-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: macos-latest
RUNTIMEID: osx-x64
OUTPUTDIR: spamfilter-osx-x64
- os: ubuntu-latest
RUNTIMEID: linux-x64
OUTPUTDIR: spamfilter-linux-x64
- os: windows-latest
RUNTIMEID: win-x64
OUTPUTDIR: spamfilter-win-x64
steps:
- uses: actions/checkout@v6
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
working-directory: Source/${{ env.SOLUTION_DIR }}
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: Source/${{ env.SOLUTION_DIR }}
- name: Test + Cover
run: ./update-coverage.sh
- name: upload code coverage to codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: Source/spamfilter/spamfilter.BL.Tests/coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)
- name: Publish
run: dotnet publish ${{ env.PROJECT }} -c Release -o ${{matrix.OUTPUTDIR}} -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -r ${{matrix.RUNTIMEID}}
working-directory: Source/${{ env.SOLUTION_DIR }}
- uses: vimtor/action-zip@v1
with:
files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/
dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip
- name: Release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip