-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53046a6
commit 5e9b24b
Showing
1 changed file
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
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 }} |