Skip to content

Commit 8ca25c6

Browse files
authored
Add GitHub Actions workflow for release process
1 parent a3253aa commit 8ca25c6

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: |
21+
8.0.x
22+
23+
- name: Restore
24+
run: dotnet restore BlockingCollectionExtensions.sln
25+
26+
- name: Build net8.0
27+
run: dotnet build BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --framework net8.0 --no-restore
28+
29+
- name: Build netstandard2.1
30+
run: dotnet build BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --framework netstandard2.1 --no-restore
31+
32+
- name: Pack
33+
run: dotnet pack BlockingCollectionExtensions/BlockingCollectionExtensions.csproj --configuration Release --no-build -p:EnablePackageValidation=true -o artifacts
34+
35+
- name: Publish packages to NuGet
36+
if: startsWith(github.ref, 'refs/tags/v')
37+
run: dotnet nuget push "./artifacts/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
39+
- name: Upload release artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: release-packages
43+
path: artifacts/*

0 commit comments

Comments
 (0)