Skip to content

Update pack.yml

Update pack.yml #5

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: Nuget
on:
push:
tags:
- '*'
jobs:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Check failure on line 15 in .github/workflows/pack.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pack.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.local/share/NuGet/v3-cache
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore & Build & Test
run: |
dotnet restore
dotnet build --no-restore -c Release
dotnet test --no-build -c Release --verbosity normal
shell: bash
- name: Pack
working-directory: nupkg
run: ./pack.ps1 ${{ github.ref_name }}
shell: pwsh
- name: Upload packages as artifact (for debugging)
uses: actions/upload-artifact@v4
with:
name: nupkgs
path: nupkg/output/*.nupkg
- name: Push packages
working-directory: nupkg
if: success() && startsWith(github.ref, 'refs/tags/')
run: ./push_packages.ps1 ${{ github.ref_name }} ${{ secrets.NUGET_API_KEY }} ${{ secrets.GIT_PAT }}
shell: pwsh