-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (42 loc) · 1.61 KB
/
deploy-master.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
name: Deploy Master
on:
release:
types: [ published ]
env:
PROJECT_NAME: Supercode.Blazor.BreadcrumbNavigation
GITHUB_FEED: https://nuget.pkg.github.com/cschulzsuper/
NUGET_FEED: https://api.nuget.org/v3/index.json
PACKAGE_VERSION: ${{ github.event.release.tag_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.*
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:Version=${PACKAGE_VERSION/v} src/$PROJECT_NAME/$PROJECT_NAME.csproj
- name: Pack
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=${PACKAGE_VERSION/v} src/$PROJECT_NAME/$PROJECT_NAME.csproj
- name: Push to GitHub Feed
run: dotnet nuget push ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg --source $GITHUB_FEED --api-key ${{github.token}} --skip-duplicate --no-symbols
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nupkg
path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg
release:
needs: build
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: nupkg
- name: Push to Nuget Feed
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}