From 24b409eb629a5d67efcaa161873e96eb7241a4c2 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:23:30 +0100 Subject: [PATCH] Create deploy-nuget --- .github/workflows/deploy-nuget | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy-nuget diff --git a/.github/workflows/deploy-nuget b/.github/workflows/deploy-nuget new file mode 100644 index 0000000..a9e2785 --- /dev/null +++ b/.github/workflows/deploy-nuget @@ -0,0 +1,28 @@ +name: Upload nuget package + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' # SDK Version to use. + source-url: https://nuget.pkg.github.com/Stone-Red-Code/index.json + env: + NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}} + - run: dotnet build --configuration Release src/CuteUtils + - name: Create the package + run: dotnet pack --configuration Release src/CuteUtils + - name: Publish the package to nuget.org + run: dotnet nuget push src/CuteUtils/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json + env: + NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}