-
-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (28 loc) · 1.03 KB
/
test.yaml
File metadata and controls
33 lines (28 loc) · 1.03 KB
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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET Test
on:
pull_request:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: ./global.json
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Set package version environment variable
run: echo "PACKAGE_VERSION=$(date -u '+%Y.%m.%d')-$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: pack
run: dotnet pack --output ./artifacts -p:version=${PACKAGE_VERSION}
- name: publish-github
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.PACKAGES_PAT }} --source https://nuget.pkg.github.com/nforgeio/index.json --skip-duplicate