@@ -26,34 +26,50 @@ jobs:
2626 uses : actions/setup-dotnet@v3
2727 with :
2828 dotnet-version : 6.0.x
29+ - name : Setup GCP credentials
30+ working-directory : ${{ github.workspace }}
31+ run : |
32+ printf '%s' "$GCP_SA_KEY_RAW" > $RUNNER_TEMP/gcp-sa-key.json
33+ chmod 600 $RUNNER_TEMP/gcp-sa-key.json
34+ echo "GOOGLE_APPLICATION_CREDENTIALS=$RUNNER_TEMP/gcp-sa-key.json" >> $GITHUB_ENV
35+ env :
36+ GCP_SA_KEY_RAW : ${{ secrets.GCP_SA_KEY }}
37+ shell : bash
38+ - name : Install google-auth
39+ working-directory : ${{ github.workspace }}
40+ run : python3 -m pip install google-auth requests
41+ shell : bash
42+ - name : Setup Java
43+ uses : actions/setup-java@v4
44+ with :
45+ distribution : ' temurin'
46+ java-version : ' 17'
2947 - name : Run Integration Tests
3048 env :
3149 BROWSERSTACK_USERNAME : ${{ secrets.BROWSERSTACK_USERNAME }}
3250 BROWSERSTACK_ACCESS_KEY : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
3351 run : dotnet test BrowserStackLocalIntegrationTests --no-build -p:Configuration=Release
3452 - name : Pack NuGet Package
3553 run : msbuild BrowserStackLocal -t:pack -p:Configuration=Release
36- - name : Setup nuget
37- uses : nuget/setup-nuget@v1
38- with :
39- nuget-api-key : ${{ secrets.NUGET_API_KEY }}
40- nuget-version : ' 5.x'
41- - name : Create PFX certificate
42- id : createPfx
43- shell : pwsh
44- env :
45- PFX_CONTENT : ${{ secrets.BASE64_PFX_CONTENT }}
46- run : |
47- $pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
48- $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
49- Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
50- Write-Output "::set-output name=PFX_PATH::$pfxPath";
5154 - name : Sign Nuget Package
52- run : nuget sign .\BrowserStackLocal\bin\Release\*.nupkg -certificatePath "${{ steps.createPfx.outputs.PFX_PATH }}" -certificatePassword "${{secrets.CERT_PASSWORD}}" -Timestamper "http://timestamp.comodoca.com"
55+ working-directory : ${{ github.workspace }}
56+ run : |
57+ chmod +x ./scripts/sign_nupkg.sh
58+ ./scripts/sign_nupkg.sh
59+ shell : bash
5360 - name : Save artifact
5461 uses : actions/upload-artifact@v4
5562 with :
5663 name : BrowserStackLocal.nupkg
5764 path : .\BrowserStackLocal\BrowserStackLocal\bin\Release\*.nupkg
5865 - name : Push package to Nuget Repository
59- run : nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
66+ working-directory : ${{ github.workspace }}
67+ run : dotnet nuget push BrowserStackLocal/BrowserStackLocal/bin/Release/*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
68+ env :
69+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
70+ shell : bash
71+ - name : Cleanup credentials
72+ if : always()
73+ working-directory : ${{ github.workspace }}
74+ run : rm -f $RUNNER_TEMP/gcp-sa-key.json
75+ shell : bash
0 commit comments