Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gricher-crto authored Feb 20, 2025
1 parent 88aaf75 commit fc16bcb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [published]

env:
nuget_directory: ${{ github.workspace}}/artifacts


jobs:
create:
runs-on: ubuntu-latest
Expand All @@ -18,30 +22,28 @@ jobs:
- name: Build
run: dotnet build -c Release
- name: Pack
run: dotnet pack -c Release -o ./artifacts
run: dotnet pack -c Release -o ${{ env.nuget_directory }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: nuget_packages
path: ./artifacts/*.nupkg
path: ${{ env.nuget_directory }}/*.nupkg
if-no-files-found: error
publish:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- Criteo.OpenApi.Comparator
- Criteo.OpenApi.Comparator.Cli
needs: [create]
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v4
with:
name: nuget_packages
path: ./artifacts/*.nupkg
- name: Publish ${{ matrix.package }} to NuGet
run: dotnet nuget push ./artifacts/${{ matrix.package }}*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
path: ${{ env.nuget_directory }}
- name: Publish all packages to NuGet
run: |
foreach($file in (Get-ChildItem "${{ env.nuget_directory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}


Expand Down

0 comments on commit fc16bcb

Please sign in to comment.