Skip to content

Commit

Permalink
Push master and release to github packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Aug 30, 2021
1 parent 2fbd666 commit 0f7ca4b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- name: Build
run: |
# GH Actions puts us in detached head, but for nbgv, we need to be on the branch
if echo "${{github.ref}}" | grep -q "^refs/heads/"; then
git checkout "$(echo ${{github.ref}} | sed -E 's|^refs/heads/||')";
fi
Expand All @@ -39,6 +40,27 @@ jobs:
name: nuget
path: bin/nuget

prerelease:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'

- name: Download nupkg
uses: actions/download-artifact@v1
with:
name: nuget

- name: Push to GitHub feed
run: dotnet nuget push nuget/*.nupkg
--api-key "${{secrets.GITHUB_TOKEN}}"
--source "https://nuget.pkg.github.com/${{github.repository_owner}}/"
--skip-duplicate

release:
runs-on: ubuntu-latest
needs: build
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
file_glob: 'true'
file: ./*.nupkg

- name: Push to GitHub feed
run: dotnet nuget push *.nupkg
--api-key "${{secrets.GITHUB_TOKEN}}"
--source "https://nuget.pkg.github.com/${{github.repository_owner}}/"
--skip-duplicate

- name: Push to NuGet
run: dotnet nuget push *.nupkg
--api-key ${{secrets.NUGET_API_KEY}}
Expand Down

0 comments on commit 0f7ca4b

Please sign in to comment.