Skip to content

Commit

Permalink
Update Nuget publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Smalls1652 committed Mar 16, 2024
1 parent 53046a6 commit 5e9b24b
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -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 }}
run: dotnet nuget push "./artifacts/package/release/*.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5e9b24b

Please sign in to comment.