From fd16232e08bd29e744aa83722c621224dde3fdc2 Mon Sep 17 00:00:00 2001 From: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:34:54 +0900 Subject: [PATCH] Create upload-to-nuget.yml --- .github/workflows/upload-to-nuget.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/upload-to-nuget.yml diff --git a/.github/workflows/upload-to-nuget.yml b/.github/workflows/upload-to-nuget.yml new file mode 100644 index 0000000..6486769 --- /dev/null +++ b/.github/workflows/upload-to-nuget.yml @@ -0,0 +1,37 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Upload to NuGet + +on: + push: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Build + run: dotnet build --configuration Release + working-directory: ./Promete + + - name: Generate nuget package. + run: dotnet pack --configuration Release -o nupkg + working-directory: ./Promete + + - name: Publish to nuget + run: find . -type f -name *.nupkg -print0 | xargs -0 -I pkg dotnet nuget push pkg -k $nuget_api_key -s "https://api.nuget.org/v3/index.json" --skip-duplicate + env: + nuget_api_key: ${{ secrets.NUGET_API_KEY }} + working-directory: ./Promete/nupkg + +