-
Notifications
You must be signed in to change notification settings - Fork 65
51 lines (41 loc) · 1.35 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build & Publish
on:
push:
branches:
- master
tags:
- "*.*.*"
workflow_dispatch:
env:
VERSION: ${{ github.ref_name }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
run: |
dotnet build -c Release Source/YoloV8/YoloV8.csproj -p:Version=${{ env.VERSION }}
dotnet build -c GpuRelease Source/YoloV8/YoloV8.csproj -p:Version=${{ env.VERSION }}
- name: Test
run: dotnet test Source/YoloV8.Tests/YoloV8.Tests.csproj
- name: Pack
run: |
dotnet pack -c Release -o . Source/YoloV8/YoloV8.csproj -p:Version=${{ env.VERSION }}
dotnet pack -c GpuRelease -o . Source/YoloV8/YoloV8.csproj -p:Version=${{ env.VERSION }}
- name: Publish
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create ${{ env.VERSION }}
--repo ${{ github.event.repository.full_name }}
--title ${{ env.VERSION }}
--generate-notes
--verify-tag