-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (30 loc) · 1.41 KB
/
nuget.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
name: "Deploy to NuGet"
on:
push:
tags:
- 'v*'
env:
PROJECT_PATH_CLI: 'ApiClient/ApiClient.csproj'
PROJECT_PATH_WRA: 'DigikeyApiWrapper/DigikeyApiWrapper.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
jobs:
deploy:
name: 'Deploy'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/[email protected]
- name: 'Restore packages'
run: dotnet restore ${{ env.PROJECT_PATH_WRA }}
- name: 'Build project'
run: dotnet build ${{ env.PROJECT_PATH_WRA }} --no-restore --configuration Release
- name: 'Get Version'
id: version
uses: battila7/[email protected]
- name: 'Pack project'
run: |
dotnet pack ${{ env.PROJECT_PATH_WRA }} --no-restore --no-build --configuration Release --include-source -p:PackageVersion=${{ steps.version.outputs.version-without-v }} -p:SymbolPackageFormat=snupkg --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
dotnet pack ${{ env.PROJECT_PATH_CLI }} --no-restore --no-build --configuration Release --include-source -p:PackageVersion=${{ steps.version.outputs.version-without-v }} -p:SymbolPackageFormat=snupkg --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: 'Push package'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}