-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (66 loc) · 1.96 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: .NET
env:
GITHUB_USER: Nihlus
GITHUB_FEED: https://nuget.pkg.github.com/Remora
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: |
dotnet restore
dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-restore --no-build --verbosity minimal
- name: Inspect
uses: JetBrains/[email protected]
with:
tool-version: 2023.3.4
solution: Remora.Commands.sln
build: false
no-build: true
telemetry-optout: true
- name: Package
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: dotnet pack -c Release --no-restore --no-build --version-suffix "github$GITHUB_RUN_ID"
- uses: actions/upload-artifact@v4
with:
name: nupkg
path: nuget/*
permissions:
security-events: write
prerelease:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
name: nupkg
path: nuget
# To ensure that the current version being pushed does not get pruned we prune first.
- name: Prune packages older than 4 versions (new version is the 5th)
uses: smartsquaregmbh/[email protected]
with:
organization: Remora
type: nuget
keep: 4
names: |
Remora.Commands
- name: Push to GitHub Feed
run: |
for f in ./nuget/*; do
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
done