Skip to content

Commit e632063

Browse files
committed
Added new nuget gha and updated examples gha.
1 parent 1b8353b commit e632063

File tree

2 files changed

+59
-7
lines changed

2 files changed

+59
-7
lines changed

.github/workflows/examples-core-win.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ jobs:
1010

1111
runs-on: windows-2022
1212

13-
steps:
14-
- uses: actions/checkout@v1 # https://github.com/actions/checkout
15-
#- name: Setup .NET Core
16-
# uses: actions/setup-dotnet@v1 # https://github.com/actions/setup-dotnet
17-
# with:
18-
# dotnet-version: 3.1.100
13+
- name: Check out repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: '8.0.x'
20+
1921
- name: Build with dotnet
2022
run: |
2123
dotnet build examples/sipexamples/sipexamples.sln --configuration Release
2224
dotnet build examples/webrtcexamples/webrtcexamples.sln --configuration Release
23-
dotnet build examples/icecmdline/icecmdline.sln --configuration Release
25+
dotnet build examples/webrtccmdline/webrtccmdline.sln --configuration Release
2426
dotnet build examples/sipcmdline/sipcmdline.sln --configuration Release
2527
dotnet build examples/stunserver/stunserver.sln --configuration Release
28+
dotnet build examples/softphone/sipsorcery.softphone.sln --configuration Release

.github/workflows/nuget.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*' # Triggers on tag pushes starting with 'v'
9+
10+
jobs:
11+
build-and-publish:
12+
strategy:
13+
matrix:
14+
framework: ['net8.0']
15+
runs-on: ubuntu-latest
16+
steps:
17+
# Checkout the repository
18+
- uses: actions/checkout@v2
19+
20+
# Set up .NET SDK
21+
- uses: actions/setup-dotnet@v2
22+
with:
23+
dotnet-version: '8.0.x'
24+
25+
# Restore dependencies
26+
- name: Restore dependencies
27+
run: dotnet restore src/SIPSorcery.csproj
28+
29+
# Build the project
30+
- name: Build
31+
run: dotnet build src/SIPSorcery.csproj -c Release --no-restore
32+
33+
# Run unit tests
34+
- name: Unit tests
35+
run: dotnet test test/unit/SIPSorcery.UnitTests.csproj --framework ${{ matrix.framework }} -c Release
36+
37+
# Pack the NuGet package
38+
- name: Pack NuGet package
39+
run: dotnet pack src/SIPSorcery.csproj -c Release -o ./artifacts
40+
41+
# Publish to NuGet
42+
# - name: Publish NuGet package
43+
# if: startsWith(github.ref, 'refs/tags/v') # Only run on tag pushes
44+
# env:
45+
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} # Set this in your repo settings
46+
# run: |
47+
# dotnet nuget push ./artifacts/*.nupkg \
48+
# --source https://api.nuget.org/v3/index.json \
49+
# --api-key $NUGET_API_KEY

0 commit comments

Comments
 (0)