diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45c0e2f..42d8597 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,27 +29,16 @@ jobs: with: fetch-depth: 0 - - name: Get gsoft-nuget-feed-ado-pat secret - id: get_gsoft_nuget_feed_ado_pat_secret - uses: workleap/wl-reusable-workflows/retrieve-managed-secret@main + - name: Authenticate to Azure Artifacts + uses: workleap/wl-reusable-workflows/az-artifact-authenticate@main with: - azure-client-id: ${{ vars.AZURE_CLIENT_ID }} - azure-tenant-id: ${{ vars.AZURE_TENANT_ID }} - azure-subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - keyvault-name: ${{ vars.IDP_CICD_KEYVAULT_NAME }} - secret-name: "gsoft-nuget-feed-ado-pat" - - - uses: actions/setup-dotnet@v4 - with: - source-url: ${{ vars.GSOFTDEV_NUGET_SOURCE }} - env: - NUGET_AUTH_TOKEN: ${{ steps.get_gsoft_nuget_feed_ado_pat_secret.outputs.secret }} + feed-url: ${{ vars.GSOFTDEV_NUGET_SOURCE }} + variables: ${{ toJSON(vars) }} - run: ./Build.ps1 shell: pwsh env: NUGET_SOURCE: ${{ vars.GSOFTDEV_NUGET_SOURCE }} - NUGET_API_KEY: ${{ steps.get_gsoft_nuget_feed_ado_pat_secret.outputs.secret }} linearb: needs: [ci] diff --git a/Build.ps1 b/Build.ps1 index 977cf22..6da995b 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -28,6 +28,9 @@ Process { if (($null -ne $env:NUGET_SOURCE) -and ($null -ne $env:NUGET_API_KEY) -and ($IsLinux)) { Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY --skip-duplicate } } + elseif (($null -ne $env:NUGET_SOURCE) -and ($null -ne $env:VSS_NUGET_ACCESSTOKEN)) { + Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k "az-api-key" --skip-duplicate } + } } finally { Pop-Location