-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.15 KB
/
dotnet-release.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: Release Build
on:
release:
types: [released, prereleased]
env:
PROJECT_PATH: '.\HappyReflection\HappyReflection.csproj'
NUGET_API_SECRET: ${{ secrets.NUGET_API_KEY }}
jobs:
build-test-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env NUGET_VERSION_NUMBER
run: |
NUGET_VERSION_NUMBER=${GITHUB_REF_NAME/v/}
echo "NUGET_VERSION_NUMBER=$NUGET_VERSION_NUMBER"
echo "NUGET_VERSION_NUMBER=$NUGET_VERSION_NUMBER" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: nuget pack
run: dotnet pack "$PROJECT_PATH" -c Release /p:Version=$NUGET_VERSION_NUMBER
- name: nuget push
run: dotnet nuget push **.nupkg -k "$NUGET_API_SECRET" --force-english-output -s "https://www.nuget.org"