Skip to content

Commit c540c3c

Browse files
committed
Check for publish keys separately
1 parent 3e49afb commit c540c3c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/build-workflow.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ on:
2626
jobs:
2727
build:
2828
runs-on: ubuntu-latest
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
NUGET_KEY: ${{ secrets.NUGET_KEY }}
32-
FEEDZ_KEY: ${{ secrets.FEEDZ_KEY }}
29+
3330
steps:
3431
- name: Checkout
3532
uses: actions/checkout@v3
@@ -60,16 +57,22 @@ jobs:
6057
if: github.event_name != 'pull_request'
6158
run: dotnet pack ${{ inputs.solution }} --configuration Release --no-build
6259
- name: Publish CI Packages
63-
if: github.event_name != 'pull_request' && env.GITHUB_TOKEN != '' && env.FEEDZ_KEY != ''
60+
if: github.event_name != 'pull_request'
6461
run: |
6562
for package in $(find -name "*.nupkg" | grep "minver" -v); do
66-
echo "${0##*/}": Pushing $package...
67-
63+
6864
# GitHub
69-
dotnet nuget push $package --source https://nuget.pkg.github.com/${{ inputs.org }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
65+
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then
66+
echo "${0##*/}": Pushing $package to GitHub...
67+
dotnet nuget push $package --source https://nuget.pkg.github.com/${{ inputs.org }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
68+
fi
7069
7170
# Feedz (remove once GitHub supports anonymous access)
72-
dotnet nuget push $package --source https://f.feedz.io/foundatio/foundatio/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate
71+
if [ -n "${{ secrets.FEEDZ_KEY }}" ]; then
72+
echo "${0##*/}": Pushing $package to Feedz...
73+
dotnet nuget push $package --source https://f.feedz.io/foundatio/foundatio/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate
74+
fi
75+
7376
done
7477
- name: Publish Release Packages
7578
if: startsWith(github.ref, 'refs/tags/v')

0 commit comments

Comments
 (0)