Skip to content

Commit c6d85f8

Browse files
committed
Setting up continuous deployment workflow
1 parent 2e089d0 commit c6d85f8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/cd.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CD
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+"
6+
jobs:
7+
deployment:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Extract VERSION
13+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
14+
shell: bash
15+
- name: Setup .NET Core 2.1 SDK
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: '2.1.x'
19+
- name: Setup .NET Core 3.1 SDK
20+
uses: actions/setup-dotnet@v1
21+
with:
22+
dotnet-version: '3.1.x'
23+
- name: Setup .NET 5.0 SDK
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: '5.0.x'
27+
- name: Restore
28+
run: dotnet restore
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
- name: Test
32+
run: dotnet test --configuration Release --no-build
33+
- name: Pack
34+
run: dotnet pack --configuration Release --no-build
35+
- name: NuGet Push Lib.AspNetCore.ServerSentEvents
36+
run: dotnet nuget push Lib.AspNetCore.ServerSentEvents/bin/Release/Lib.AspNetCore.ServerSentEvents.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
37+
shell: bash
38+
env:
39+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)