Skip to content

fix workflow

fix workflow #1

Workflow file for this run

name: Publish NuGet Packages
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: ./src
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 Disc.NET.sln
- name: Build package version
shell: bash
run: |
VERSION="1.0.${{ github.run_number }}"
echo "PACKAGE_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Pack
run: dotnet pack Disc.NET.sln --configuration Release --no-restore --output ./artifacts -p:Version=${{ env.PACKAGE_VERSION }}
- name: Publish to NuGet
run: dotnet nuget push "./artifacts/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate