diff --git a/.github/workflows/build_openvpn_linux.yml b/.github/workflows/build_openvpn_linux.yml index 92cb74e..4bd8f9c 100644 --- a/.github/workflows/build_openvpn_linux.yml +++ b/.github/workflows/build_openvpn_linux.yml @@ -123,6 +123,7 @@ jobs: 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]') || @@ -138,6 +139,9 @@ jobs: O3: "${{ github.workspace }}/O3" DEP_DIR: "${{ github.workspace }}/O3/deps" DL: "${{ github.workspace }}/O3/dl" + CFLAGS: "-static-libgcc -g -O1 -ldl" + OPEN_SSL_VER: "1.1.1t" + steps: - name: Set up build environment uses: awalsh128/cache-apt-pkgs-action@latest @@ -165,13 +169,28 @@ jobs: cd core/scripts/linux/ ./build-all + - name: Build OpenSSL + run: | + curl https://www.openssl.org/source/openssl-${OPEN_SSL_VER}.tar.gz | tar zx + cd openssl-${OPEN_SSL_VER} + ./Configure no-shared no-tests linux-x86_64 enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp -static-libgcc --openssldir=/usr/local/lib + echo "************************************************" + echo "******** Compiling OpenSSL..." + echo "************************************************" + make + echo "************************************************" + echo "******** Copying OpenSSL include folder and static libraries..." + # if you want to use OS-default SHARED openssl libraries - not necessary to compile it. + # Just copy required headers of OpenSSL (include folder) + sudo make install + - 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 -DOPENSSL_ROOT_DIR=${{ github.workspace }}/openssl-${OPEN_SSL_VER} -DCMAKE_EXE_LINKER_FLAGS="-ldl -static-libgcc -static " .. cmake --build . --config Release --target ovpncli - name: Archive artifacts @@ -209,6 +228,25 @@ jobs: overwrite: true file_glob: true + ovpn3-release: + name: GitHub Release + needs: Build-OpenVPN3-Linux + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + + steps: + - name: Setup | Checkout + uses: actions/checkout@v2 + + - name: Setup | Artifacts + uses: actions/download-artifact@v2 + + - name: Setup | Checksums + run: for file in $(find ./ -name 'o*' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done + + - name: Zip ALL + run: for file in *; do zip -r ${file%.*}.zip $file; done + - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: @@ -216,4 +254,5 @@ jobs: file: openvpn3-linux.zip tag: ${{ github.ref }} overwrite: true - file_glob: true + file_glob: true + diff --git a/.github/workflows/build_openvpn_macos.yml b/.github/workflows/build_openvpn_macos.yml index 1c3c279..6ea5f71 100644 --- a/.github/workflows/build_openvpn_macos.yml +++ b/.github/workflows/build_openvpn_macos.yml @@ -157,10 +157,13 @@ jobs: contains(github.event.head_commit.message, '[openvpn]') name: "${{matrix.os}} - ${{matrix.arch}}" - + env: + BUILD_DIR: ${{ github.workspace }}/build + OPEN_SSL_VER: "1.1.1t" + steps: - name: Install dependencies - run: brew install asio cmake jsoncpp lz4 openssl pkg-config + run: brew install asio cmake jsoncpp pkg-config - name: Creating work-folder run: | @@ -172,6 +175,34 @@ jobs: repository: amnezia-vpn/openvpn3 ref: win-amezia path: ${{ github.workspace }}/src/openvpn3 + + - name: Build OpenSSL + run: | + curl https://www.openssl.org/source/openssl-${OPEN_SSL_VER}.tar.gz | tar zx + cd openssl-${OPEN_SSL_VER} + if [ ${_ARCH} = "arm64" ]; then + ./Configure darwin64-arm64-cc no-shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-arm64 + else + ./Configure darwin64-x86_64-cc no-shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64 + fi + + echo "************************************************" + echo "******** Compiling OpenSSL..." + echo "************************************************" + make + + echo "************************************************" + echo "******** Copying OpenSSL include folder and static libraries..." + sudo make install + + - name: Build LZ4 + run: | + git clone https://github.com/lz4/lz4 + cd lz4 + git checkout release + CLFAGS="-mmacosx-version-min=10.6" make + CLFAGS="-mmacosx-version-min=10.6" sudo make install + sudo rm /usr/local/lib/liblz*.dylib - name: Build MacOS OpenVPN3 run: | @@ -179,7 +210,7 @@ jobs: 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 -DOPENSSL_ROOT_DIR=${{ github.workspace }}/openssl-${OPEN_SSL_VER} -DCMAKE_PREFIX_PATH=/usr/local/opt ${{ github.workspace }}/src/openvpn3 cmake --build . --config Release --target ovpncli - name: Archive artifacts