fix workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |