-
-
Notifications
You must be signed in to change notification settings - Fork 135
55 lines (43 loc) · 1.39 KB
/
dotnet.yml
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
name: Generic Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 50
- run: git fetch --tags
- name: Setup .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: "[ -f .ci-skip-tests ] && echo 'Skipping tests' || dotnet test --no-build --verbosity normal"
- name: Pack
if: github.ref == 'refs/heads/master'
run: dotnet pack -c Debug -o Build
- name: "Github packages: Nuget push"
if: github.ref == 'refs/heads/master'
run: dotnet nuget push --no-symbols --skip-duplicate -k ${{ secrets.GITHUB_TOKEN }} -s "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" Build/*.nupkg
- name: "Github packages: Cleanup"
if: github.ref == 'refs/heads/master'
uses: stripethree/gpr-janitor@dist
with:
dry-run: false
keep-versions: 25
min-age-days: 14
versions-to-fetch: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}