diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3e5a169..3c49b47 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -8,6 +8,10 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + id-token: write + jobs: test: name: Run Integration Tests @@ -49,9 +53,6 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - - - name: Pack NuGet Package - run: dotnet pack src/IlyaKo.AspNet.SideAuth/IlyaKo.AspNet.SideAuth.csproj --configuration Release --output ./output - name: Extract Version from Tag id: get_version @@ -65,9 +66,15 @@ jobs: /p:PackageVersion=${{ env.VERSION }} \ /p:Version=${{ env.VERSION }} + - name: NuGet Login (OIDC) + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGET_ORG_LOGIN }} + - name: Push to NuGet.org run: | dotnet nuget push ./output/*.nupkg \ - --api-key ${{ secrets.NUGET_API_KEY }} \ + --api-key ${{ steps.login.outputs.NUGET_API_KEY }} \ --source https://api.nuget.org/v3/index.json \ --skip-duplicate