Skip to content

Commit

Permalink
Create publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Jul 29, 2023
1 parent 7d0bbfb commit e8fe5eb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
release:
types: [ published ]

jobs:
build:
name: Build

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
7.0.x
6.0.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore

- name: Test
run: dotnet test -c Release --no-build --verbosity normal

- name: Publish the package to nuget.org
run: dotnet nuget push MinimalXmlReader/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

- name: Publish the package to github.com
run: dotnet nuget push MinimalXmlReader/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json

- name: Upload the package to this release
run: gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/*.nupkg

0 comments on commit e8fe5eb

Please sign in to comment.