Skip to content

Commit c014d85

Browse files
committed
GHA workflow: publish to NuGet on tag
1 parent 0cca7b5 commit c014d85

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,18 @@ jobs:
77
publish:
88
runs-on: ubuntu-latest
99
steps:
10-
- id: echo
11-
run: echo "hello $GITHUB_REF"
10+
- run: echo "hello $GITHUB_REF and ${{ github.event.release.tag_name }}"
11+
- uses: actions/setup-dotnet@v1
12+
- uses: actions/checkout@v2
13+
with:
14+
ref: $GITHUB_REF
15+
fetch-depth: 0
16+
- name: build
17+
run: dotnet build --configuration Release
18+
- name: pack
19+
run: dotnet pack --no-build \
20+
--configuration Release mongo-declarative-indexes/mongo-declarative-indexes.csproj \
21+
-p:PackageVersion=${{ github.event.release.tag_name }} \
22+
--output .
23+
-name: push
24+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)