Skip to content

Commit

Permalink
Finalised release action file
Browse files Browse the repository at this point in the history
  • Loading branch information
GaProgMan committed Dec 2, 2024
1 parent b875338 commit 948fcc2
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET Core
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
Expand All @@ -32,14 +32,47 @@ jobs:

- name: Build
run: dotnet build --configuration Release --no-restore

test:
needs: [build]
runs-on: ubuntu-latest
name: Run all tests

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Run all tests
run: dotnet test OwaspHeaders.Core.Tests/OwaspHeaders.Core.Tests.csproj

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: pack
run: dotnet pack src/OwaspHeaders.Core.csproj --configuration Release --no-build --no-restore
package:
needs: [build, test]
runs-on: ubuntu-latest
name: Create and upload NuGet package

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Build NuGet package
run: dotnet pack src/OwaspHeaders.Core.csproj --configuration Release

- name: Push NuGet package
run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}

0 comments on commit 948fcc2

Please sign in to comment.