forked from rwg0/csharpfits
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.01 KB
/
dotnet.yml
File metadata and controls
46 lines (39 loc) · 1.01 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
name: CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_CONF: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c $BUILD_CONF -p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test -c $BUILD_CONF
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: '**/*.nupkg'
retention-days: 5
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download NuGet packages
uses: actions/download-artifact@v4
with:
name: nuget-packages
- name: Push NuGet package
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate