-
Notifications
You must be signed in to change notification settings - Fork 50
36 lines (32 loc) · 1.17 KB
/
publish.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
name: Package and publish
on:
push:
branches:
- main
paths:
- '.github/workflows/publish.yml'
- 'Src/Witsml/**'
workflow_dispatch:
permissions:
packages: read
jobs:
build:
name: Package and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup .NET 7
uses: actions/setup-dotnet@a351d9ea84bc76ec7508debf02a39d88f8b6c0c0 # v2.1.1
with:
dotnet-version: 7.0.x
source-url: https://nuget.pkg.github.com/equinor/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Build
run: dotnet build Src/Witsml/Witsml.csproj /warnaserror --configuration Release
- name: Test
run: dotnet test ./Tests/Witsml.Tests/Witsml.Tests.csproj --configuration Release
- name: Package
run: dotnet pack --configuration Release Src/Witsml -p:Version=2.8.${GITHUB_RUN_NUMBER}
- name: Publish
run: dotnet nuget push --api-key ${{secrets.NUGET_PUBLISH_KEY}} --source https://api.nuget.org/v3/index.json Src/Witsml/bin/Release/WitsmlClient.2.8.${GITHUB_RUN_NUMBER}.nupkg