Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
on: [workflow_dispatch]

# Least privilege: no step in this workflow writes to the repo,
# releases or packages via GITHUB_TOKEN (publishing uses NUGET_API_KEY,
# releases or packages via GITHUB_TOKEN (publishing uses NUGET_API_KEY, (deprecated, now uses trusted publishing setup)
# signing uses GCP_SA_KEY). Fail closed regardless of the org default.
permissions:
contents: read
id-token: write

defaults:
run:
Expand All @@ -17,6 +18,11 @@
runs-on: windows-latest

steps:
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: browserstack
- uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@c26a08ba26249b81327e26f6ef381897b6a8754d # v1.0.2
Expand Down Expand Up @@ -70,9 +76,9 @@
path: .\BrowserStackLocal\BrowserStackLocal\bin\Release\*.nupkg
- name: Push package to Nuget Repository
working-directory: ${{ github.workspace }}
run: dotnet nuget push BrowserStackLocal/BrowserStackLocal/bin/Release/*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push BrowserStackLocal/BrowserStackLocal/bin/Release/*.nupkg --api-key "${{steps.login.outputs.NUGET_API_KEY}}" --source https://api.nuget.org/v3/index.json
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
shell: bash
- name: Cleanup credentials
if: always()
Expand Down
Loading