From 5e9b24b216033c534f1a69dc5b55a53a21ce94c6 Mon Sep 17 00:00:00 2001 From: Timothy Small Date: Sat, 16 Mar 2024 16:53:03 -0400 Subject: [PATCH] Update Nuget publish workflow --- .github/workflows/publish-package.yml | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 890f965..bdce9bb 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,30 +1,40 @@ name: Publish Nuget Package + on: release: types: [ published ] + +permissions: + contents: read + packages: write + jobs: - build: + publish: + name: "Publish" runs-on: ubuntu-latest - permissions: - contents: read - packages: write + strategy: + matrix: + project: [ + ".src/Lib" + ] + steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Setup .NET + - name: Setup dotnet SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + global-json-file: global.json - name: Configure GitHub package registry source run: dotnet nuget add source --username Smalls1652 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Smalls1652/index.json" - name: Run dotnet restore - run: dotnet restore SmallsOnline.Subnetting.Lib.sln + run: dotnet restore ${{ matrix.project }} - name: Create package - run: dotnet pack SmallsOnline.Subnetting.Lib.sln --configuration Release --no-restore --output . + run: dotnet pack ${{ matrix.project }} --configuration "Release" --no-restore - name: Publish package - run: dotnet nuget push "*.nupkg" --source github --api-key ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + run: dotnet nuget push "./artifacts/package/release/*.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file