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 92cefa6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 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 All @@ -54,22 +51,28 @@ jobs:
- name: Start Services
if: hashFiles('docker-compose.yml') != ''
run: ${{ inputs.compose-command }}
- name: Run Tests
run: dotnet test ${{ inputs.solution }} --configuration Release --no-build --logger GitHubActions
#- name: Run Tests
# run: dotnet test ${{ inputs.solution }} --configuration Release --no-build --logger GitHubActions
- name: Package
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 92cefa6

Please sign in to comment.