From f7709fcb7784002b306b96458af3834a62c81758 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sat, 24 Sep 2022 00:57:13 +0300 Subject: [PATCH] Create release-nuget.yml --- .github/workflows/release-nuget.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/release-nuget.yml diff --git a/.github/workflows/release-nuget.yml b/.github/workflows/release-nuget.yml new file mode 100644 index 0000000..4673aad --- /dev/null +++ b/.github/workflows/release-nuget.yml @@ -0,0 +1,37 @@ +name: Release Module on NuGet/GPR + +on: + workflow_call: + inputs: + project_path: + required: true + type: string + secrets: + NUGET_API_KEY: + required: true + +jobs: + publish-on-github: + name: Publish Module on NuGet/GPR + runs-on: ubuntu-latest + steps: + + - name: Setup + uses: butr/actions-common-setup@v2.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Pack + run: dotnet pack ${{ inputs.project_path }} --configuration Release -o "./packages" + shell: pwsh + + - name: Push to NuGet + run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org --skip-duplicate + shell: pwsh + + - name: Push to GPR + run: | + for f in ./packages/*.nupkg + do + curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/ + done