2020-07-21 23:01:19 +03:00
|
|
|
parameters:
|
2020-07-28 00:34:34 +03:00
|
|
|
- name: architecture
|
|
|
|
type: string
|
2020-08-16 03:15:25 +03:00
|
|
|
- name: compilerPath
|
|
|
|
type: string
|
2020-07-28 00:34:34 +03:00
|
|
|
- name: vcpkgTriplet
|
|
|
|
type: string
|
|
|
|
- name: vcvarsPath
|
2020-07-21 23:01:19 +03:00
|
|
|
type: string
|
|
|
|
|
|
|
|
steps:
|
2020-07-28 00:34:34 +03:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: '"vcpkg-installed-windows-${{parameters.architecture}}"'
|
|
|
|
path: 'C:/vcpkg/installed'
|
|
|
|
displayName: 'Environment storage'
|
|
|
|
- script: |
|
|
|
|
vcpkg install openssl zlib --triplet ${{parameters.vcpkgTriplet}}
|
|
|
|
workingDirectory: C:/vcpkg
|
|
|
|
displayName: 'Prepare environment'
|
2020-07-21 23:01:19 +03:00
|
|
|
- script: |
|
2020-07-28 00:34:34 +03:00
|
|
|
call "${{parameters.vcvarsPath}}"
|
2020-08-16 03:15:25 +03:00
|
|
|
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{parameters.vcpkgTriplet}} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER="${{parameters.compilerPath}}" -DCMAKE_CXX_COMPILER="${{parameters.compilerPath}}" $(Build.SourcesDirectory)
|
2020-07-21 23:01:19 +03:00
|
|
|
cmake --build .
|
2020-07-27 09:10:20 +03:00
|
|
|
workingDirectory: $(Build.BinariesDirectory)
|
2020-07-21 23:01:19 +03:00
|
|
|
displayName: 'Build'
|
2020-07-27 09:10:20 +03:00
|
|
|
- script: |
|
|
|
|
mkdir "$(Build.StagingDirectory)/installers"
|
2020-07-28 00:34:34 +03:00
|
|
|
vpnsetup /SFXMODE:vpnclient /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnclient-$(Build.SourceVersion)-${{parameters.architecture}}.exe"
|
|
|
|
vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnserver_vpnbridge-$(Build.SourceVersion)-${{parameters.architecture}}.exe"
|
2020-07-27 09:10:20 +03:00
|
|
|
workingDirectory: $(Build.BinariesDirectory)
|
|
|
|
displayName: 'Build installers'
|
2020-07-21 23:01:19 +03:00
|
|
|
- powershell: |
|
2020-07-28 00:34:34 +03:00
|
|
|
. .ci/appveyor-vpntest.ps1
|
2020-07-21 23:01:19 +03:00
|
|
|
displayName: 'Test'
|
|
|
|
- task: CopyFiles@2
|
|
|
|
inputs:
|
|
|
|
sourceFolder: '$(Build.BinariesDirectory)'
|
|
|
|
contents: '?(*.exe|*.se2|*.pdb)'
|
2020-07-27 09:10:20 +03:00
|
|
|
TargetFolder: '$(Build.StagingDirectory)/binaries'
|
2020-07-21 23:01:19 +03:00
|
|
|
flattenFolders: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
inputs:
|
2020-07-27 09:10:20 +03:00
|
|
|
pathtoPublish: '$(Build.StagingDirectory)/binaries'
|
2020-07-21 23:01:19 +03:00
|
|
|
artifactName: 'Binaries'
|
2020-07-27 09:10:20 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
inputs:
|
|
|
|
pathtoPublish: '$(Build.StagingDirectory)/installers'
|
|
|
|
artifactName: 'Installers'
|