diff --git a/.github/workflows/build_openvpn_linux.yml b/.github/workflows/build_openvpn_linux.yml index 5142425..92cb74e 100644 --- a/.github/workflows/build_openvpn_linux.yml +++ b/.github/workflows/build_openvpn_linux.yml @@ -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 @@ -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 diff --git a/.github/workflows/build_openvpn_macos.yml b/.github/workflows/build_openvpn_macos.yml index 76bc372..1c3c279 100644 --- a/.github/workflows/build_openvpn_macos.yml +++ b/.github/workflows/build_openvpn_macos.yml @@ -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 @@ -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 diff --git a/.github/workflows/build_openvpn_windows.yml b/.github/workflows/build_openvpn_windows.yml index 85d9808..752778c 100644 --- a/.github/workflows/build_openvpn_windows.yml +++ b/.github/workflows/build_openvpn_windows.yml @@ -65,16 +65,52 @@ jobs: (Get-Content ${{ github.workspace }}/openvpn/src/openvpn/openvpn.vcxproj).Replace('_CRT_NONSTDC_NO_DEPRECATE;', '_CRT_NONSTDC_NO_DEPRECATE;ENABLE_DEBUG;') | Set-Content ${{ github.workspace }}/openvpn/src/openvpn/openvpn.vcxproj msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform="${{ matrix.plat }}" . - - name: Archive artifacts - uses: actions/upload-artifact@v3 + 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 + steps: + - uses: actions/checkout@v3 + + - uses: lukka/get-cmake@latest + - uses: ilammy/msvc-dev-cmd@v1 with: - name: openvpn-win-${{ matrix.plat }} - path: | - 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 + 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