-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.78 KB
/
release.yml
File metadata and controls
61 lines (50 loc) · 1.78 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release
on:
workflow_dispatch:
inputs:
publish_to_nuget:
description: Publish packages to NuGet
required: true
default: false
type: boolean
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Restore
run: dotnet restore BlockingCollectionExtensions.sln
- name: Build net8.0
run: dotnet build BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --framework net8.0 --no-restore
- name: Build netstandard2.1
run: dotnet build BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --framework netstandard2.1 --no-restore
- name: Test
run: dotnet test BlockingCollectionExtensions.sln --configuration Release --no-restore
- name: Pack
run: dotnet pack BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --no-build -p:EnablePackageValidation=true -o artifacts
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: release-packages
path: artifacts/*
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/v') || inputs.publish_to_nuget
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
test -n "$NUGET_API_KEY"
dotnet nuget push "artifacts/*.nupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate