Skip to content

Commit

Permalink
feat: Add NuGet publish workflow on Release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
BiDuang authored Nov 29, 2023
1 parent d91d7c4 commit 6696976
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Release Version NuGet Package

on:
push:
branches: [Release]
tags:
- 'v*'
jobs:
test-build:
name: Test build on ${{ matrix.os }} .NET 8.0
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Build Test
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
publish-package:
name: Publish package
runs-on: windows-latest
needs: [test-build]
if: needs.test-build.result == 'success'
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Create the package
run: dotnet pack ProjBobcat/ProjBobcat.sln -c Release
- name: Publish the package to NuGet.org
run: dotnet nuget push -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json "ProjBobcat/ProjBobcat/bin/Release/*.nupkg"

0 comments on commit 6696976

Please sign in to comment.