-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.05 KB
/
on-push-to-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
name: Build
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
CI_IS_PUSH_TO_MAIN: true
steps:
# Get the code and set up the environment.
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
# Build
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore /warnaserror
# Publish to nuget.org.
- name: Pack
run: dotnet pack --configuration Release --no-build --output nuget-out
- name: Publish to nuget.org
run: dotnet nuget push --api-key ${{ secrets.NUGET_API_KEY_DOCKERSDK }} --source https://api.nuget.org/v3/index.json nuget-out/*.nupkg
if: ${{ (github.ref == 'refs/heads/main') && (env.DRY_RUN != '1') }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY_DOCKERSDK }}