-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.78 KB
/
main.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
name: Publish to Package Registries
on:
release:
types:
- published
workflow_dispatch:
env:
GH_NUGET_REGISTRY: https://nuget.pkg.github.com/
GH_NUGET_NAMESPACE: trueanalyticssolutions
GH_NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}
VS_PROJECT: TcpAdapter
jobs:
build:
name: Build Package
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@main
with:
dotnet-version: '3.1'
- name: Build Mtconnect.TcpAdapter with dotnet
run: dotnet build "Mtconnect.TcpAdapter\TcpAdapter.csproj" --configuration Release
- name: Pack Mtconnect.TcpAdapter
run: dotnet pack "Mtconnect.TcpAdapter\TcpAdapter.csproj" --configuration Release -o finalpackage --no-build --include-symbols
- name: Publish Artifact
uses: actions/upload-artifact@master
with:
name: nupkg
path: finalpackage
deploy:
needs: build
name: Deploy Packages
runs-on: windows-latest
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@main
with:
dotnet-version: '3.1'
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: nupkg
- name: Setup NuGet
uses: NuGet/setup-nuget@main
with:
nuget-api-key: ${{ secrets.NUGETORG_API_KEY }}
nuget-version: latest
- name: Push Mtconnect.TcpAdapter to NuGet
run: dotnet nuget push nupkg\*.nupkg -k ${{ secrets.NUGETORG_API_KEY }} -s https://nuget.org --skip-duplicate
- name: Push NuGet package to GitHub Packages
run: dotnet nuget push nupkg\*.nupkg --source ${{ env.GH_NUGET_REGISTRY }}${{ env.GH_NUGET_NAMESPACE }} --api-key ${{ env.GH_NUGET_API_KEY }}