Skip to content

Commit e96c42b

Browse files
author
Dustin Masters
committed
Update actions
1 parent bec1717 commit e96c42b

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/dotnet-core.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: .NET Core
1+
name: .NET Core - Build only
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
75
branches: [ main ]
86

@@ -23,3 +21,11 @@ jobs:
2321
run: dotnet build --configuration Release --no-restore
2422
- name: Test
2523
run: dotnet test --no-restore --verbosity normal
24+
- name: Pack
25+
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release -o .
26+
- uses: actions/upload-artifact@v2
27+
with:
28+
name: nuget-packages
29+
path: |
30+
**/*.nupkg
31+
**/*.snupkg
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: .NET Core - Build and push
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup .NET Core
15+
uses: actions/setup-dotnet@v1
16+
with:
17+
dotnet-version: 3.1.301
18+
- name: Install dependencies
19+
run: dotnet restore
20+
- name: Build
21+
run: dotnet build --configuration Release --no-restore
22+
- name: Test
23+
run: dotnet test --no-restore --verbosity normal
24+
- name: Pack
25+
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release -o .
26+
- uses: actions/upload-artifact@v2
27+
with:
28+
name: nuget-packages
29+
path: |
30+
**/*.nupkg
31+
**/*.snupkg
32+
- name: Publish
33+
env:
34+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
35+
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k "$NUGET_API_KEY" --skip-duplicate -n 1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.snupkg
2+
13
## Ignore Visual Studio temporary files, build results, and
24
## files generated by popular Visual Studio add-ons.
35

0 commit comments

Comments
 (0)