Build Cloak plugin for MacOS NE #284
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
name: windows-openvpn | |
on: [push] | |
jobs: | |
msvc: | |
strategy: | |
fail-fast: false | |
matrix: | |
plat: [ARM64, Win32, x64] | |
include: | |
- plat: ARM64 | |
triplet: arm64 | |
- plat: Win32 | |
triplet: x86 | |
- plat: x64 | |
triplet: x64 | |
name: "OpenVPN msbuild" | |
env: | |
BUILD_CONFIGURATION: Release | |
VCPKG_OVERLAY_PORTS: ${{ github.workspace }}/openvpn/contrib/vcpkg-ports | |
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}/openvpn/contrib/vcpkg-triplets | |
runs-on: windows-2019 | |
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 | |
- name: 'Get openvpn' | |
uses: actions/checkout@v3 | |
with: | |
repository: OpenVPN/openvpn | |
ref: release/2.5 | |
path: openvpn | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install rst2html | |
run: python -m pip install --upgrade pip rst2html | |
- uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2 | |
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Restore from cache and install vcpkg | |
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5 | |
with: | |
vcpkgGitCommitId: 8b04a7bd93bef991818fc372bb83ce00ec1c1c16 | |
vcpkgJsonGlob: '**/windows/vcpkg.json' | |
- name: Run MSBuild consuming vcpkg.json | |
working-directory: openvpn | |
run: | | |
${{ github.workspace }}/vcpkg/vcpkg.exe integrate install | |
(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 | |
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 | |
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-win | |
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 | |
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 '*.exe' -or -name '*.dll' ); 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: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: openvpn-win-ARM64.zip | |
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: openvpn-win-Win32.zip | |
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: openvpn-win-x64.zip | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
ovpn3-release: | |
name: GitHub Release | |
needs: openvpn3-msvc | |
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 '*.exe' -or -name '*.dll' ); 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: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: openvpn3-win.zip | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |