Skip to content

Commit

Permalink
Merge pull request #181 from bchavez/vcpkg
Browse files Browse the repository at this point in the history
Improve Windows Build and AppVeyor Artifacts
  • Loading branch information
s-vincent authored Oct 18, 2018
2 parents 36ae3d5 + 61618c0 commit 48d94a7
Show file tree
Hide file tree
Showing 9 changed files with 413 additions and 379 deletions.
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@ environment:
matrix:
- platform: x64
ARCH_BITS: 64
INSTALLER_BITS: amd64
- platform: x86
ARCH_BITS: 32
INSTALLER_BITS: x86

configuration:
- Release
- Debug

init:
- '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%'


install:
- cinst cmake
- xcopy /I third-party\vcpkg\ports\miniupnpc c:\tools\vcpkg\ports\miniupnpc
# Install python wheels, necessary to install SCons via pip
- python -m pip install wheel
# Install SCons
- python -m pip install scons==2.5.1
- scons --version

before_build:
- vcpkg install libiconv --triplet %PLATFORM%-windows-static
Expand All @@ -32,7 +40,25 @@ before_build:
build_script:
- 'nmake -f Makefile.windows build_%CONFIGURATION%_%PLATFORM%'

after_build:
- 7z a BuildArtifacts.zip install\*
- ps: >-
$gitHash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 8);
$zipFile = "freelan-binary-$env:platform-$gitHash.zip";
Push-AppveyorArtifact "BuildArtifacts.zip" -FileName $zipFile;
If ($env:Configuration -Match "Release") {
scons -C packaging\windows --arch=%INSTALLER_BITS%
$setupFile = "freelan-setup-$env:platform-$gitHash.exe";
$installerFile = Get-ChildItem -Path .\packaging\windows\ -Filter *.exe | Select-Object -First 1;
Push-AppveyorArtifact $installerFile.FullName -FileName $setupFile;
}
branches:
only:
- master
- vcpkg

on_failure:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
6 changes: 4 additions & 2 deletions defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def local_path(self):
def repository_root(self):
if self._repository_root is None:
try:
if self.no_git:
if ('APPVEYOR' in os.environ) or self.no_git:
self._repository_root = self.local_path
else:
self._repository_root = os.path.abspath(check_output(['git', 'rev-parse', '--show-toplevel']).rstrip())
Expand All @@ -49,7 +49,9 @@ def repository_root(self):
def repository_version(self):
if self._repository_version is None:
try:
if self.no_git:
if 'APPVEYOR_REPO_COMMIT' in os.environ:
self._repository_version = os.environ['APPVEYOR_REPO_COMMIT'].rstrip()
elif self.no_git:
if 'FREELAN_NO_GIT_VERSION' not in os.environ:
raise RuntimeError(errstr='You must specify FREELAN_NO_GIT_VERSION when FREELAN_NO_GIT is specified.')

Expand Down
Loading

0 comments on commit 48d94a7

Please sign in to comment.