-
Notifications
You must be signed in to change notification settings - Fork 51
37 lines (33 loc) · 1.21 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
37
name: Package and publish
on:
push:
branches:
- main
paths:
- '.github/workflows/publish.yml'
- 'Src/Witsml/**'
workflow_dispatch:
permissions:
packages: read
jobs:
build:
if: github.repository_owner == 'equinor'
name: Package and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET 8
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 8.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.9.${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.9.${GITHUB_RUN_NUMBER}.nupkg