Skip to content

Merge pull request #38 from marcelwemhoff/feature/UpdateDependencies #22

Merge pull request #38 from marcelwemhoff/feature/UpdateDependencies

Merge pull request #38 from marcelwemhoff/feature/UpdateDependencies #22

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: "Publish to nuget.org"
on:
push:
branches:
- "main"
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create Version
run: echo "VERSION=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" ./Directory.Build.props)" >> $GITHUB_ENV
- name: Print Version
run: echo ${{ env.VERSION }}
- uses: ./.github/workflows/build-action
- if: ${{startsWith(github.event.ref, 'refs/tags/v')}}
name: Publish Release NuGet
run: |
dotnet clean
dotnet build -c Release /p:Version="${{ env.VERSION }}.${{ github.run_number }}"
dotnet pack -c Release /p:Version="${{ env.VERSION }}.${{ github.run_number }}" /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate
- if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
name: Publish Prerelease NuGet
run: |
dotnet clean
dotnet build -c Debug /p:Version="${{ env.VERSION }}.${{ github.run_number }}-prerelease"
dotnet pack -c Debug /p:Version="${{ env.VERSION }}.${{ github.run_number }}-prerelease" /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}-prerelease.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate