-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dotnet-core.yml github workflow script
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: .NET Core | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
ubuntu: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.301 | ||
- name: Install .net dependencies | ||
run: dotnet restore | ||
- name: Install libpcap | ||
run: sudo -E bash scripts/install-libpcap.sh | ||
- name: Build | ||
run: dotnet build -c Release | ||
- name: Test | ||
run: dotnet test | ||
- name: publish on version change | ||
id: publish_nuget | ||
uses: rohith/publish-nuget@v2 | ||
with: | ||
# Filepath of the project to be packaged, relative to root of repository | ||
PROJECT_FILE_PATH: PacketDotNetConnections/PacketDotNetConnections.csproj | ||
|
||
# API key to authenticate with NuGet server | ||
NUGET_KEY: ${{secrets.NUGET_API_KEY}} | ||
|
||
windows: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.301 | ||
- name: Install .net dependencies | ||
run: dotnet restore | ||
- name: Install winpcap | ||
uses: crazy-max/ghaction-chocolatey@v1 | ||
with: | ||
args: install winpcap | ||
- name: Build | ||
run: dotnet build -c Release | ||
- name: Test | ||
run: dotnet test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# the default installation of libpcap does not have remote pcap enabled | ||
# so we need to compile our own | ||
# see https://github.com/the-tcpdump-group/libpcap/issues/795 | ||
|
||
# Those are the dependencies needed to build libpcap | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Mac OSX, use https://www.macports.org/ | ||
port install bison | ||
port install flex | ||
else | ||
# Ubuntu | ||
apt-get install -y build-essential bison flex | ||
fi | ||
|
||
# clone into tmp folder | ||
rm -rf /tmp/install-libpcap | ||
|
||
# 1.9.1 is the version we tested to work | ||
git clone --depth 1 -b libpcap-1.9.1 https://github.com/the-tcpdump-group/libpcap.git /tmp/install-libpcap | ||
|
||
pushd /tmp/install-libpcap | ||
|
||
# remote is disabled by default, so we need to enable it | ||
./configure --enable-remote --disable-universal | ||
|
||
# install the library | ||
make install | ||
|
||
# create the necessary links and cache | ||
# see https://www.mono-project.com/docs/advanced/pinvoke/dllnotfoundexception/ | ||
ldconfig | ||
|
||
popd |