Skip to content

Commit c47c9d0

Browse files
authored
Test NuGet package build (#138)
build(nuget): test NuGet package build Add action to verify proper NuGet package build outcome.
1 parent 39bd2d8 commit c47c9d0

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ jobs:
3939
ref: master
4040
- name: Add msbuild to PATH
4141
uses: microsoft/[email protected]
42+
- name: Setup .NET 2.1.519
43+
uses: actions/setup-dotnet@v1
44+
with:
45+
dotnet-version: 2.1.519
46+
- name: Setup .NET 5.0.x
47+
uses: actions/setup-dotnet@v1
48+
with:
49+
dotnet-version: 5.0.x
4250
- name: Build packages
4351
env:
4452
WORKSPACE_PATH: ${{ github.workspace }}

.github/workflows/release/build-packages.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ mkdir "$RELEASES_PATH"
88
mkdir "$ARTIFACTS_PATH"
99

1010
# Build Api package.
11+
echo "Build Api package"
1112
cd "$githubWorkspace\src\Api\PubnubApi"
1213
dotnet pack -o "$RELEASES_PATH\Api" -c Release
1314

1415
# Build PCL package.
16+
echo "Build PCL package"
1517
cd "$githubWorkspace\src\Api\PubnubApiPCL"
1618
dotnet pack -o "$RELEASES_PATH\PCL" -c Release
1719

1820
# Build UWP package.
21+
echo "Build UWP package"
1922
cd "$githubWorkspace\src\Api\PubnubApiUWP"
2023
dotnet restore
2124
msbuild PubnubApiUWP.csproj /t:Pack /p:Configuration=Release /p:PackageOutputPath="$RELEASES_PATH\UWP" /v:n
2225

26+
echo "Copy built packages"
2327

2428
# Copy built packages to artifacts folder.
2529
$PACKAGE_NAME = Get-ChildItem -Name -Path "$RELEASES_PATH\Api\*" -Include *.nupkg

.github/workflows/run-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'master'
7+
workflow_dispatch:
8+
9+
jobs:
10+
tests:
11+
name: NuGet packages build
12+
runs-on: windows-2019
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
- name: Add msbuild to PATH
17+
uses: microsoft/[email protected]
18+
- name: Setup .NET 2.1.519
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: 2.1.519
22+
- name: Setup .NET 5.0.x
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: 5.0.x
26+
- name: Build packages
27+
env:
28+
WORKSPACE_PATH: ${{ github.workspace }}
29+
run: .\\.github\\workflows\\release\\build-packages.ps1
30+
shell: powershell

.github/workflows/run_acceptance_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ defaults:
1313

1414
jobs:
1515
build:
16-
17-
runs-on: windows-latest
16+
name: Build
17+
runs-on: windows-2019
1818

1919
steps:
2020
- name: Checkout Project
@@ -33,13 +33,13 @@ jobs:
3333
with:
3434
token: ${{ secrets.GH_TOKEN }}
3535

36-
- name: Setup .NET
36+
- name: Setup .NET 5.0.x
3737
uses: actions/setup-dotnet@v1
3838
with:
3939
dotnet-version: 5.0.x
4040
- name: Restore dependencies
4141
run: dotnet restore
42-
- name: Build
42+
- name: Build Projects
4343
run: cd ./UnitTests/AcceptanceTests && dotnet build --no-restore
4444
- name: Test
4545
env:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,5 @@ src/UnitTests/MockServer/obj/*
167167
# GitHub Actions #
168168
##################
169169
.github/.release
170+
171+
.idea

0 commit comments

Comments
 (0)