Skip to content

Commit 8232d81

Browse files
committed
Push master and release to github packages
1 parent 2fbd666 commit 8232d81

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
2929
- name: Build
3030
run: |
31+
# GH Actions puts us in detached head, but for nbgv, we need to be on the branch
3132
if echo "${{github.ref}}" | grep -q "^refs/heads/"; then
3233
git checkout "$(echo ${{github.ref}} | sed -E 's|^refs/heads/||')";
3334
fi
@@ -39,6 +40,27 @@ jobs:
3940
name: nuget
4041
path: bin/nuget
4142

43+
prerelease:
44+
runs-on: ubuntu-latest
45+
needs: build
46+
if: ${{ github.ref == 'refs/heads/master' }}
47+
steps:
48+
- name: Setup dotnet
49+
uses: actions/setup-dotnet@v1
50+
with:
51+
dotnet-version: '5.0.100'
52+
53+
- name: Download nupkg
54+
uses: actions/download-artifact@v1
55+
with:
56+
name: nuget
57+
58+
- name: Push to GitHub feed
59+
run: dotnet nuget push nuget/*.nupkg
60+
--api-key "${{github.repository_owner}}:${{secrets.GITHUB_TOKEN}}"
61+
--source "https://nuget.pkg.github.com/${{github.repository_owner}}/"
62+
--skip-duplicate
63+
4264
release:
4365
runs-on: ubuntu-latest
4466
needs: build

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
file_glob: 'true'
2525
file: ./*.nupkg
2626

27+
- name: Push to GitHub feed
28+
run: dotnet nuget push *.nupkg
29+
--api-key "${{github.repository_owner}}:${{secrets.GITHUB_TOKEN}}"
30+
--source "https://nuget.pkg.github.com/${{github.repository_owner}}/"
31+
--skip-duplicate
32+
2733
- name: Push to NuGet
2834
run: dotnet nuget push *.nupkg
2935
--api-key ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)