Skip to content

Commit b7ddec3

Browse files
Keep github actions for CI and CD separate
1 parent e33a38b commit b7ddec3

File tree

2 files changed

+59
-19
lines changed

2 files changed

+59
-19
lines changed

.github/workflows/cd.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: .NET package CD
2+
3+
on: [workflow_dispatch]
4+
5+
defaults:
6+
run:
7+
working-directory: BrowserStackLocal
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Add msbuild to PATH
16+
uses: microsoft/[email protected]
17+
- name: Build BrowserStackLocal
18+
run: |
19+
msbuild BrowserStackLocal -t:restore -p:Configuration=Release
20+
msbuild BrowserStackLocal -t:build -p:Configuration=Release
21+
- name: Build Test project
22+
run: |
23+
msbuild BrowserStackLocalIntegrationTests -t:restore -p:Configuration=Release
24+
msbuild BrowserStackLocalIntegrationTests -t:build -p:Configuration=Release
25+
- name: Setup .NET Core
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: 3.1.301
29+
- name: Run Integration Tests
30+
env:
31+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
32+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
33+
run: dotnet test BrowserStackLocalIntegrationTests --no-build -p:Configuration=Release
34+
- name: Pack NuGet Package
35+
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";
51+
- 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"
53+
- name: Save artifact
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: BrowserStackLocal.nupkg
57+
path: .\BrowserStackLocal\BrowserStackLocal\bin\Release\*.nupkg
58+
- name: Push package to Nuget Repository
59+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

.github/workflows/ci.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,8 @@ jobs:
3333
run: dotnet test BrowserStackLocalIntegrationTests --no-build -p:Configuration=Release
3434
- name: Pack NuGet Package
3535
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";
51-
- 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"
5336
- name: Save artifact
5437
uses: actions/upload-artifact@v2
5538
with:
5639
name: BrowserStackLocal.nupkg
5740
path: .\BrowserStackLocal\BrowserStackLocal\bin\Release\*.nupkg
58-
- name: Push package to Nuget Repository
59-
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)