WrapThat.TheAnswer.Myget #1
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
name: WrapThat.TheAnswer.Myget | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test scenario tags' | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
publish: | |
name: Build, pack & publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore --verbosity normal | |
# Publish | |
# Create the NuGet package in the package folder | |
- name: Pack | |
run: dotnet pack --configuration Release --no-build --output package | |
# Publish the NuGet package as an artifact, so they can be used in the following jobs | |
#- uses: actions/upload-artifact@v3 | |
# with: | |
# name: nuget | |
# if-no-files-found: error | |
# retention-days: 7 | |
# path: ${{ package}}/*.nupkg | |
- name: Publish nupkg and snupkg to NuGet.org | |
run: | | |
foreach($file in (Get-ChildItem package -Recurse -Include *.nupkg)) { | |
dotnet nuget push $file --api-key "${{ secrets.WRAPTHATMYGET }}" --source https://www.myget.org/feed/Packages/hermit --skip-duplicate | |
} | |
foreach($file in (Get-ChildItem "package" -Recurse -Include *.snupkg)) { | |
dotnet nuget push $file --api-key "${{ secrets.WRAPTHATMYGET }}" --source https://www.myget.org/feed/Packages/hermit --skip-duplicate | |
} |