diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml index 4612e8f2..3214c5dc 100644 --- a/.github/workflows/build-workflow.yml +++ b/.github/workflows/build-workflow.yml @@ -26,10 +26,7 @@ on: jobs: build: runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NUGET_KEY: ${{ secrets.NUGET_KEY }} - FEEDZ_KEY: ${{ secrets.FEEDZ_KEY }} + steps: - name: Checkout uses: actions/checkout@v3 @@ -60,16 +57,22 @@ jobs: if: github.event_name != 'pull_request' run: dotnet pack ${{ inputs.solution }} --configuration Release --no-build - name: Publish CI Packages - if: github.event_name != 'pull_request' && env.GITHUB_TOKEN != '' && env.FEEDZ_KEY != '' + if: github.event_name != 'pull_request' run: | for package in $(find -name "*.nupkg" | grep "minver" -v); do - echo "${0##*/}": Pushing $package... - + # GitHub - dotnet nuget push $package --source https://nuget.pkg.github.com/${{ inputs.org }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then + echo "${0##*/}": Pushing $package to GitHub... + dotnet nuget push $package --source https://nuget.pkg.github.com/${{ inputs.org }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + fi # Feedz (remove once GitHub supports anonymous access) - dotnet nuget push $package --source https://f.feedz.io/foundatio/foundatio/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate + if [ -n "${{ secrets.FEEDZ_KEY }}" ]; then + echo "${0##*/}": Pushing $package to Feedz... + dotnet nuget push $package --source https://f.feedz.io/foundatio/foundatio/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate + fi + done - name: Publish Release Packages if: startsWith(github.ref, 'refs/tags/v')