Skip to content

Commit

Permalink
test package validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Staffa committed Jan 11, 2024
1 parent 2a542e9 commit 60a75ec
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["2.2.108", "8.0.x"]
dotnet-version: ["2.2.108", "8.0.x", "6.0.x"]
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
Expand All @@ -24,18 +24,16 @@ jobs:
run: dotnet build --configuration Release
- name: Test
run: dotnet test src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj
- name: Create nuget package
run: dotnet pack . -p:PackageVersion=${{ github.event.inputs.version }} -o
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304

- name: Validate NuGet package
run: dotnet-validate package local out/*.nupkg

publish:
needs: build
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Publish
if: github.event_name == 'workflow_dispatch'
run: |
dotnet pack . -p:PackageVersion=${{ github.event.inputs.version }} -o .
dotnet nuget push src/PostalCodes/PostalCodes.${{ github.event.inputs.version }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
Expand Down

0 comments on commit 60a75ec

Please sign in to comment.