-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CMakeLists.txt for macOS; Clean up workflow
- Loading branch information
1 parent
bade2ab
commit 368b7e8
Showing
3 changed files
with
112 additions
and
147 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 |
---|---|---|
|
@@ -7,172 +7,130 @@ on: | |
branches: [ '*' ] | ||
|
||
jobs: | ||
build-macos: | ||
runs-on: macos-latest | ||
job: | ||
env: | ||
VCPKG_ROOT: '${{ github.workspace }}\vcpkg' | ||
name: build-${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ macos-latest, ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup CMake and dependencies on macOS | ||
if: ${{ runner.os == 'macOS' }} | ||
run: | | ||
brew install cmake libevent libpcap libsodium openssl | ||
- name: Compile and configure Pcap_DNSProxy | ||
- name: Setup CMake, GCC, and dependencies on Ubuntu | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
cd Source/Auxiliary/Scripts | ||
chmod +x CMake_Build.sh | ||
# Workaround from https://stackoverflow.com/a/30895165 | ||
export C_INCLUDE_PATH=/usr/local/include | ||
export CPLUS_INCLUDE_PATH=/usr/local/include | ||
# Fuck Xcode | ||
./CMake_Build.sh | ||
sudo apt-get update | ||
sudo apt-get install -y gcc g++ cmake libevent-dev libpcap-dev libsodium-dev libssl-dev | ||
- name: Create artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Pcap_DNSProxy-bin-macOS | ||
path: Source/Release/ | ||
- name: Install MSBuild | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: microsoft/[email protected] | ||
|
||
build-ubuntu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Restore vcpkg and its artifacts | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: actions/cache@v3 | ||
id: vcpkg-cache | ||
with: | ||
path: | | ||
${{ env.VCPKG_ROOT }} | ||
${{ env.VCPKG_ROOT }}\packages | ||
!${{ env.VCPKG_ROOT }}\.git | ||
!${{ env.VCPKG_ROOT }}\buildtrees | ||
!${{ env.VCPKG_ROOT }}\downloads | ||
Source/Tools | ||
key: | | ||
${{ hashFiles( 'vcpkg.bat' ) }}-${{ runner.os }}-cache-key-v1 | ||
- name: Install vcpkg and dependencies | ||
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
git clone https://github.com/Microsoft/vcpkg.git | ||
.\vcpkg\bootstrap-vcpkg.bat | ||
.\vcpkg.bat | ||
.\vcpkg\vcpkg integrate install | ||
- name: Setup CMake, GCC, and dependencies | ||
- name: Locate dependencies | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y gcc g++ cmake libevent-dev libpcap-dev libsodium-dev libssl-dev | ||
mkdir Source/Dependency | ||
mkdir Source/Dependency/LibEvent | ||
mkdir Source/Dependency/LibEvent/Include_Windows | ||
mkdir Source/Dependency/LibSodium | ||
mkdir Source/Dependency/LibSodium/Include_Windows | ||
mkdir Source/Dependency/WinPcap | ||
mkdir Source/Dependency/WinPcap/Include | ||
- name: Build the solution | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
cp -Recurse vcpkg/packages/libevent_x64-windows/include/* Source/Dependency/LibEvent/Include_Windows | ||
cp -Recurse vcpkg/packages/libevent_x64-windows/lib/event_core.lib Source/Dependency/LibEvent/LibEvent_Core_x64.lib | ||
cp -Recurse vcpkg/packages/libsodium_x64-windows/include/* Source/Dependency/LibSodium/Include_Windows | ||
cp -Recurse vcpkg/packages/libsodium_x64-windows/lib/libsodium.lib Source/Dependency/LibSodium/LibSodium_x64.lib | ||
cp -Recurse vcpkg/packages/libpcap_x64-windows/include/* Source/Dependency/WinPcap/Include | ||
cp -Recurse vcpkg/packages/winpcap_x64-windows/lib/Packet.lib Source/Dependency/WinPcap/Packet_x64.lib | ||
cp -Recurse vcpkg/packages/winpcap_x64-windows/lib/wpcap.lib Source/Dependency/WinPcap/WPCAP_X64.lib | ||
msbuild Source/Pcap_DNSProxy.sln /p:Configuration=Release /p:Platform=x64 /p:AdditionalIncludeDirectories="$GITHUB_WORKSPACE\vcpkg\installed\x64-windows\include" | ||
cp -Recurse -Force vcpkg/packages/libevent_x86-windows/include/* Source/Dependency/LibEvent/Include_Windows | ||
cp -Recurse -Force vcpkg/packages/libevent_x86-windows/lib/event_core.lib Source/Dependency/LibEvent/LibEvent_Core_x86.lib | ||
cp -Recurse -Force vcpkg/packages/libsodium_x86-windows/include/* Source/Dependency/LibSodium/Include_Windows | ||
cp -Recurse -Force vcpkg/packages/libsodium_x86-windows/lib/libsodium.lib Source/Dependency/LibSodium/LibSodium_x86.lib | ||
cp -Recurse -Force vcpkg/packages/libpcap_x86-windows/include/* Source/Dependency/WinPcap/Include | ||
cp -Recurse -Force vcpkg/packages/winpcap_x86-windows/lib/Packet.lib Source/Dependency/WinPcap/Packet_x86.lib | ||
cp -Recurse -Force vcpkg/packages/winpcap_x86-windows/lib/wpcap.lib Source/Dependency/WinPcap/WPCAP_X86.lib | ||
msbuild Source/Pcap_DNSProxy.sln /p:Configuration=Release /p:Platform=x86 /p:AdditionalIncludeDirectories="$GITHUB_WORKSPACE\vcpkg\installed\x86-windows\include" | ||
- name: Compile and configure Pcap_DNSProxy | ||
run: | | ||
cd Source/Auxiliary/Scripts | ||
chmod +x CMake_Build.sh | ||
./CMake_Build.sh | ||
- name: Download Support | ||
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
cd Source | ||
mkdir Tools | ||
mkdir Tools/Support | ||
Invoke-WebRequest https://www.winpcap.org/install/bin/WinPcap_4_1_3.exe -OutFile Tools/WinPcap_4.1.3.exe | ||
Invoke-WebRequest https://westmesatech.com/files/sst27.zip -OutFile Tools/sst27.zip | ||
Expand-Archive Tools/sst27.zip -DestinationPath Tools/Support | ||
Invoke-WebRequest https://www.fourmilab.ch/md5/md5.zip -OutFile Tools/md5.zip | ||
Expand-Archive Tools/md5.zip -DestinationPath Tools/Support | ||
Invoke-WebRequest https://github.com/mbuilov/sed-windows/raw/master/sed-4.9-x86.exe -OutFile Tools/Support/sed.exe | ||
- name: Package release | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
cd Source | ||
mkdir Release/x64 | ||
cp -Recurse x64/Release/* Release/x64 | ||
cp Auxiliary/ExampleConfig/Config.ini Release | ||
cp Auxiliary/ExampleConfig/Hosts.ini Release | ||
cp Auxiliary/ExampleConfig/IPFilter.ini Release | ||
cp Auxiliary/ExampleConfig/Routing.txt Release | ||
cp Auxiliary/ExampleConfig/WhiteList.txt Release | ||
cp Auxiliary/ExampleConfig/ServiceControl.bat Release | ||
mkdir Release/Tools | ||
cp -Recurse Auxiliary/Tools/* Release/Tools | ||
cp Tools/WinPcap_4.1.3.exe Release/Tools | ||
mkdir Release/Tools/Support | ||
cp Tools/Support/CCase.exe Release/Tools/Support | ||
cp (Get-Command curl.exe).Path Release/Tools/Support | ||
cp Tools/Support/md5.exe Release/Tools/Support | ||
cp Tools/Support/sed.exe Release/Tools/Support | ||
- name: Create artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Pcap_DNSProxy-bin-Ubuntu | ||
name: Pcap_DNSProxy-bin-${{ runner.os }} | ||
path: Source/Release/ | ||
|
||
build-windows: | ||
env: | ||
VCPKG_ROOT: '${{ github.workspace }}\vcpkg' | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install MSBuild | ||
uses: microsoft/[email protected] | ||
|
||
- name: Restore vcpkg and its artifacts | ||
uses: actions/cache@v3 | ||
id: vcpkg-cache | ||
with: | ||
path: | | ||
${{ env.VCPKG_ROOT }} | ||
${{ env.VCPKG_ROOT }}\packages | ||
!${{ env.VCPKG_ROOT }}\.git | ||
!${{ env.VCPKG_ROOT }}\buildtrees | ||
!${{ env.VCPKG_ROOT }}\downloads | ||
Source/Tools | ||
key: | | ||
${{ runner.os }}-ncpkg-dependencies-${{ hashFiles('.github/workflows/build.yml') }} | ||
- name: Install vcpkg | ||
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
git clone https://github.com/Microsoft/vcpkg.git | ||
cd vcpkg | ||
.\bootstrap-vcpkg.bat | ||
- name: Intergrate vcpkg with MSBuild | ||
run: | | ||
cd vcpkg | ||
.\vcpkg integrate install | ||
- name: Install dependencies with vcpkg | ||
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
cd vcpkg | ||
.\vcpkg install libevent libpcap libsodium openssl | ||
.\vcpkg remove libpcap | ||
.\vcpkg install winpcap | ||
.\vcpkg install libevent:x86-windows libpcap:x86-windows libsodium:x86-windows openssl:x86-windows | ||
.\vcpkg remove libpcap:x86-windows | ||
.\vcpkg install winpcap:x86-windows | ||
- name: Locate dependencies | ||
run: | | ||
mkdir Source/Dependency | ||
mkdir Source/Dependency/LibEvent | ||
mkdir Source/Dependency/LibEvent/Include_Windows | ||
mkdir Source/Dependency/LibSodium | ||
mkdir Source/Dependency/LibSodium/Include_Windows | ||
mkdir Source/Dependency/WinPcap | ||
mkdir Source/Dependency/WinPcap/Include | ||
- name: Build the solution for x64 | ||
run: | | ||
cp -Recurse vcpkg/packages/libevent_x64-windows/include/* Source/Dependency/LibEvent/Include_Windows | ||
cp -Recurse vcpkg/packages/libevent_x64-windows/lib/event_core.lib Source/Dependency/LibEvent/LibEvent_Core_x64.lib | ||
cp -Recurse vcpkg/packages/libsodium_x64-windows/include/* Source/Dependency/LibSodium/Include_Windows | ||
cp -Recurse vcpkg/packages/libsodium_x64-windows/lib/libsodium.lib Source/Dependency/LibSodium/LibSodium_x64.lib | ||
cp -Recurse vcpkg/packages/libpcap_x64-windows/include/* Source/Dependency/WinPcap/Include | ||
cp -Recurse vcpkg/packages/winpcap_x64-windows/lib/Packet.lib Source/Dependency/WinPcap/Packet_x64.lib | ||
cp -Recurse vcpkg/packages/winpcap_x64-windows/lib/wpcap.lib Source/Dependency/WinPcap/WPCAP_X64.lib | ||
msbuild Source/Pcap_DNSProxy.sln /p:Configuration=Release /p:Platform=x64 /p:AdditionalIncludeDirectories="$GITHUB_WORKSPACE\vcpkg\installed\x64-windows\include" | ||
- name: Build the solution for x86 | ||
run: | | ||
cp -Recurse -Force vcpkg/packages/libevent_x86-windows/include/* Source/Dependency/LibEvent/Include_Windows | ||
cp -Recurse -Force vcpkg/packages/libevent_x86-windows/lib/event_core.lib Source/Dependency/LibEvent/LibEvent_Core_x86.lib | ||
cp -Recurse -Force vcpkg/packages/libsodium_x86-windows/include/* Source/Dependency/LibSodium/Include_Windows | ||
cp -Recurse -Force vcpkg/packages/libsodium_x86-windows/lib/libsodium.lib Source/Dependency/LibSodium/LibSodium_x86.lib | ||
cp -Recurse -Force vcpkg/packages/libpcap_x86-windows/include/* Source/Dependency/WinPcap/Include | ||
cp -Recurse -Force vcpkg/packages/winpcap_x86-windows/lib/Packet.lib Source/Dependency/WinPcap/Packet_x86.lib | ||
cp -Recurse -Force vcpkg/packages/winpcap_x86-windows/lib/wpcap.lib Source/Dependency/WinPcap/WPCAP_X86.lib | ||
msbuild Source/Pcap_DNSProxy.sln /p:Configuration=Release /p:Platform=x86 /p:AdditionalIncludeDirectories="$GITHUB_WORKSPACE\vcpkg\installed\x86-windows\include" | ||
- name: Download Support | ||
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
cd Source | ||
mkdir Tools | ||
mkdir Tools/Support | ||
Invoke-WebRequest https://www.winpcap.org/install/bin/WinPcap_4_1_3.exe -OutFile Tools/WinPcap_4.1.3.exe | ||
Invoke-WebRequest https://westmesatech.com/files/sst27.zip -OutFile Tools/sst27.zip | ||
Expand-Archive Tools/sst27.zip -DestinationPath Tools/Support | ||
Invoke-WebRequest https://www.fourmilab.ch/md5/md5.zip -OutFile Tools/md5.zip | ||
Expand-Archive Tools/md5.zip -DestinationPath Tools/Support | ||
Invoke-WebRequest https://github.com/mbuilov/sed-windows/raw/master/sed-4.9-x86.exe -OutFile Tools/Support/sed.exe | ||
- name: Package release | ||
run: | | ||
cd Source | ||
mkdir Release/x64 | ||
cp -Recurse x64/Release/* Release/x64 | ||
cp Auxiliary/ExampleConfig/Config.ini Release | ||
cp Auxiliary/ExampleConfig/Hosts.ini Release | ||
cp Auxiliary/ExampleConfig/IPFilter.ini Release | ||
cp Auxiliary/ExampleConfig/Routing.txt Release | ||
cp Auxiliary/ExampleConfig/WhiteList.txt Release | ||
cp Auxiliary/ExampleConfig/ServiceControl.bat Release | ||
mkdir Release/Tools | ||
cp -Recurse Auxiliary/Tools/* Release/Tools | ||
cp Tools/WinPcap_4.1.3.exe Release/Tools | ||
mkdir Release/Tools/Support | ||
cp Tools/Support/CCase.exe Release/Tools/Support | ||
cp (Get-Command curl.exe).Path Release/Tools/Support | ||
cp Tools/Support/md5.exe Release/Tools/Support | ||
cp Tools/Support/sed.exe Release/Tools/Support | ||
- name: Create artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Pcap_DNSProxy-bin-Windows | ||
path: Source/Release |
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
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,7 @@ | ||
cd vcpkg | ||
.\vcpkg install libevent libpcap libsodium openssl | ||
.\vcpkg remove libpcap | ||
.\vcpkg install winpcap | ||
.\vcpkg install libevent:x86-windows libpcap:x86-windows libsodium:x86-windows openssl:x86-windows | ||
.\vcpkg remove libpcap:x86-windows | ||
.\vcpkg install winpcap:x86-windows |