From 11798a1ae9151a9c381979c89ec7ef81161e5599 Mon Sep 17 00:00:00 2001 From: Haytam Zanid Date: Fri, 27 Oct 2023 11:30:23 +0100 Subject: [PATCH] Add new workflow to push to nuget --- .github/workflows/push.yml | 30 ++++++++++++++++++++++++++++++ Blazor.Diagrams.sln | 1 + 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000..73a9ff327 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,30 @@ +name: PushToNuget +env: + NUGET_DIR: '${{ github.workspace }}/nuget' + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Pack Blazor.Diagrams.Core + working-directory: src/Blazor.Diagrams.Core + run: 'dotnet pack --configuration Release --output ${{ env.NUGET_DIR }}' + + - name: Pack Blazor.Diagrams + working-directory: src/Blazor.Diagrams + run: 'dotnet pack --configuration Release --output ${{ env.NUGET_DIR }}' + + - name: Pack Blazor.Diagrams.Algorithms + working-directory: src/Blazor.Diagrams.Algorithms + run: 'dotnet pack --configuration Release --output ${{ env.NUGET_DIR }}' + + - name: Push + run: | + foreach($file in (Get-ChildItem "${{ env.NUGET_DIR }}" -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + } diff --git a/Blazor.Diagrams.sln b/Blazor.Diagrams.sln index 5f73d1027..862fc051e 100644 --- a/Blazor.Diagrams.sln +++ b/Blazor.Diagrams.sln @@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .github\workflows\build.yml = .github\workflows\build.yml CHANGELOG.md = CHANGELOG.md .github\workflows\main.yml = .github\workflows\main.yml + .github\workflows\push.yml = .github\workflows\push.yml README.md = README.md EndProjectSection EndProject