mirror of
https://github.com/LANCommander/IPXRelay.git
synced 2026-08-01 01:53:15 -04:00
Add build/publish to NuGet workflow
This commit is contained in:
parent
aa8f666635
commit
0ecce6e4fb
1 changed files with 49 additions and 0 deletions
49
.github/workflows/IPXRelayDotNet.Release.yml
vendored
Normal file
49
.github/workflows/IPXRelayDotNet.Release.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
name: IPXRelayDotNet Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
prep:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version_tag: ${{ steps.trim_tag_ref.outputs.replaced }}
|
||||
version_semver: ${{ steps.trim_tag_ref.outputs.replaced }}
|
||||
steps:
|
||||
- uses: frabert/replace-string-action@v2
|
||||
name: Trim Tag Ref
|
||||
id: trim_tag_ref
|
||||
with:
|
||||
string: '${{ github.ref }}'
|
||||
pattern: 'refs/tags/v'
|
||||
replace-with: ''
|
||||
|
||||
publish:
|
||||
needs: prep
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore IPXRelay/IPXRelayDotNet.csproj
|
||||
|
||||
- name: Build project
|
||||
run: dotnet build --configuration Release IPXRelay/IPXRelayDotNet.csproj -p:Version="${{ needs.prep.outputs.version_tag }}" -p:AssemblyVersion="${{ needs.prep.outputs.version_semver }}"
|
||||
|
||||
- name: Pack NuGet package with symbols
|
||||
run: dotnet pack IPXRelay/IPXRelayDotNet.csproj --no-build --configuration Release -p:PackageVersion=${{ needs.prep.outputs.version_tag }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o ./artifacts
|
||||
|
||||
- name: Publish NuGet package
|
||||
run: |
|
||||
dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
|
||||
Loading…
Add table
Add a link
Reference in a new issue