Skip to content

Commit

Permalink
Build Desktop OpenVPN3 cli with PT plugin
Browse files Browse the repository at this point in the history
[openvpn]
  • Loading branch information
outspace committed Nov 14, 2023
1 parent bb219c8 commit 3daa561
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_openssl_macos_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
contains(github.event.head_commit.message, '[ios]') ||
contains(github.event.head_commit.message, '[macos-openssl]') ||
contains(github.event.head_commit.message, '[ios-openssl]') ||
contains(github.event.head_commit.message, '[openvpn]')
contains(github.event.head_commit.message, '[openssl]')
name: "OpenSSL for MacOS,iOS"
steps:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/build_openvpn_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,67 @@ jobs:
name: openvpn-linux
path: openvpn/buildOvpn/*

Build-OpenVPN3-Linux:
name: 'Build-OpenVPN3-Ubuntu'
runs-on: ubuntu-20.04
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[linux]') ||
contains(github.event.head_commit.message, '[linux-openvpn]') ||
contains(github.event.head_commit.message, '[openvpn]')
strategy:
matrix:
arch: [x86_64] #, x86, arm32, arm64]
fail-fast: false

env:
O3: "${{ github.workspace }}/O3"
DEP_DIR: "${{ github.workspace }}/O3/deps"
DL: "${{ github.workspace }}/O3/dl"
steps:
- name: Set up build environment
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: g++ make libmbedtls-dev libssl-dev liblz4-dev cmake gcc-multilib g++-multilib libnl-genl-3-dev libcap-ng-dev libpam0g-dev
version: 1.0

- name: Creating work-folder
run: |
mkdir -pv ${{env.O3}}
mkdir -pv ${{env.DEP_DIR}}
mkdir -pv ${{env.DL}}
- name: 'Get openvpn'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/openvpn3
ref: win-amezia
path: ${{env.O3}}/core

- name: 'Build dependencies'
working-directory: ${{env.O3}}
run: |
export MTLS=0
cd core/scripts/linux/
./build-all
- name: 'Build the OpenVPN 3 client wrapper'
working-directory: ${{env.O3}}
run: |
cd ${{env.O3}}/core
cp -rf openvpn/plugin/linux/ck-ovpn-plugin.h openvpn/transport/client/pluggable/ck-ovpn-plugin.h
mkdir build && cd build
cmake ..
cmake --build . --config Release --target ovpncli
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: openvpn3-linux
path: ${{env.O3}}/core/build/test


github-release:
name: GitHub Release
needs: Build-OpenVPN-Linux
Expand Down Expand Up @@ -147,3 +208,12 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: openvpn3-linux.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
59 changes: 57 additions & 2 deletions .github/workflows/build_openvpn_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,53 @@ jobs:
name: openvpn-macos
path: openvpn/buildOvpn/*

Build-OpenVPN3-MacOS:
strategy:
fail-fast: false
matrix:
os: [macos-12]
arch: [x86_64] #, arm64]


runs-on: ${{matrix.os}}
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[macos-openvpn]') ||
contains(github.event.head_commit.message, '[openvpn]')
name: "${{matrix.os}} - ${{matrix.arch}}"

steps:
- name: Install dependencies
run: brew install asio cmake jsoncpp lz4 openssl pkg-config

- name: Creating work-folder
run: |
mkdir -p ${{ github.workspace }}/src
- name: 'Get openvpn'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/openvpn3
ref: win-amezia
path: ${{ github.workspace }}/src/openvpn3

- name: Build MacOS OpenVPN3
run: |
cd ${{ github.workspace }}/src/
mkdir build-openvpn3
cd build-openvpn3
cp -rf ${{ github.workspace }}/src/openvpn3/openvpn/plugin/darwin/ck-ovpn-plugin.h ${{ github.workspace }}/src/openvpn3/openvpn/transport/client/pluggable/ck-ovpn-plugin.h
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_PREFIX_PATH=/usr/local/opt ${{ github.workspace }}/src/openvpn3
cmake --build . --config Release --target ovpncli
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: openvpn3-macos
path: ${{ github.workspace }}/src/build-openvpn3

github-release:
name: GitHub Release
needs: macos
Expand All @@ -167,5 +214,13 @@ jobs:
file: openvpn-macos.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true

file_glob: true

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: openvpn3-macos.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
63 changes: 61 additions & 2 deletions .github/workflows/build_openvpn_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,59 @@ jobs:
openvpn/${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.exe
openvpn/${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.dll
openvpn/${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.pdb
openvpn/doc/openvpn.8.html
openvpn/doc/openvpn.8.html
openvpn3-msvc:
strategy:
matrix:
arch: [amd64]

env:
VCPKG_ROOT: ${{ github.workspace }}/openvpn3/vcpkg
BUILD_CONFIGURATION: Release
buildDir: '${{ github.workspace }}/openvpn3/build'

runs-on: windows-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[windows]') ||
contains(github.event.head_commit.message, '[windows-openvpn]') ||
contains(github.event.head_commit.message, '[openvpn]')
steps:
- uses: actions/checkout@v3

- uses: lukka/get-cmake@latest
- uses: ilammy/msvc-dev-cmd@v1
with:
working-directory: openvpn3
arch: ${{ matrix.arch }}

- name: 'Get openvpn3'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/openvpn3
ref: win-amezia
path: openvpn3

- name: 'Build OpenVPN3'
working-directory: openvpn3
run: |
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/openvpn3/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/openvpn3/deps/vcpkg-ports"
cmake --build build --config Release --target ovpncli
- uses: actions/upload-artifact@v2
with:
name: openvpn3-${{ matrix.arch }}
path: |
${{ env.buildDir }}/**/*.exe
${{ env.buildDir }}/**/*.dll
!${{ env.buildDir }}/test/ssl/**
!${{ env.buildDir }}/test/unittests/**
!${{ env.buildDir }}/CMakeFiles/**
!${{ env.buildDir }}/vcpkg_installed/**
github-release:
name: GitHub Release
needs: msvc
Expand Down Expand Up @@ -119,7 +170,15 @@ jobs:
file: openvpn-win-x64.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file_glob: true

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: openvpn3-win.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true


0 comments on commit 3daa561

Please sign in to comment.