Skip to content

Commit

Permalink
Check for publish keys separately
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Jan 6, 2023
1 parent 3e49afb commit c540c3c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit c540c3c

Please sign in to comment.