.appveyor.yml
# In AppVeyor's web config add an enviremont variable named GITHUB_TOKEN.
# Set it to a token you've created on GitHub.
# To draft a release on GitHub with AppVeyor, create a tag on master.
version: '{build}-{branch}'
#init:
# # Enable Remotedesktop and pause the build execution
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
environment:
PYTHON: 'C:\Stackless27'
PYTHONPATH: 'C:\Stackless27;C:\Stackless27\Scripts;C:\Stackless27\DLLs;C:\Stackless27\Lib;C:\Stackless27\Lib\site-packages;'
matrix:
fast_finish: true
cache:
# Invalidate cache if .appveyor.yml has changed
- C:\Stackless27 -> .appveyor.yml
# Manually clear cache:
# from agithub.AppVeyor import AppVeyor
# ci = AppVeyor(<your appveyor API token>)
# status, data = ci.api.projects.<appveyor username>.<appveyor projectname>.buildcache.delete()
# print status # 204 = Ok, cache deleted
install:
# HTML Help Workshop 1.32
# - cinst html-help-workshop
# Microsoft Visual C++ Redistributable 2008 (version min: 9.0.21022.8)
# - cinst vcredist2008
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- ps: |
$Env:PATH = $Env:PATH -replace "Python27", "Stackless27"
$PythonFolder = $Env:PYTHON
$PythonScripts = $PythonFolder + "\Scripts"
$SitePackages = $PythonFolder + "\lib\site-packages"
$SysWOW = $Env:SYSTEMROOT + "\SysWOW64"
$PythonWindowsDLL = $SysWOW + "\python27.dll"
$PythonDLL = $PythonFolder + "\python27.dll"
$InstallersFolder = $Env:APPVEYOR_BUILD_FOLDER + "\_build\installers\"
Remove-Item $PythonWindowsDLL
New-Item $InstallersFolder -type directory | Out-Null
" "
"=============== prepare EventGhost build environment ==============="
If (-not (Test-Path $PythonFolder))
{
Function PipInstall ($msg, $mod)
{
" "
"--- " + $msg
" Installing..."
pip install -q $mod
" Done."
}
" "
"--- Stackless 2.7.12150 x86"
$StacklessInstaller = $InstallersFolder + "python-2.7.12150-stackless.msi"
$StacklessInstallDir = "TARGETDIR=" + $PythonFolder
$StacklessURL = "http://www.stackless.com/binaries/python-2.7.12150-stackless.msi"
Start-FileDownload $StacklessURL -Timeout 60000 -FileName $StacklessInstaller
" Installing..."
Start-Process MsiExec.exe -Arg "/I $StacklessInstaller /quiet /passive /qn /norestart $StacklessInstallDir" -Wait
" Done."
" "
"--- wxPython 3.0.2.0"
$WXInstaller = $InstallersFolder + "wxPython3.0-win32-3.0.2.0-py27.exe"
$WXURL = "http://downloads.sourceforge.net/wxpython/wxPython3.0-win32-3.0.2.0-py27.exe"
Start-FileDownload $WXURL -Timeout 60000 -FileName $WXInstaller
" Installing..."
Start-Process $WXInstaller -Arg "/VERYSILENT /SUPPRESSMSGBOXES" -NoNewWindow -Wait
" Done."
" "
"--- pip 9.0.1"
" Updating..."
python -m pip install --no-cache-dir -q -U "pip==9.0.1"
" Done."
" "
"--- setuptools 34.3.0"
" Updating..."
pip install -q -U "setuptools==34.3.0"
" Done."
PipInstall "wheel 0.29.0" "wheel==0.29.0"
PipInstall "sphinx 1.7.5" "sphinx==1.7.5"
PipInstall "commonmark 0.7.3" "commonmark==0.7.3"
PipInstall "pillow 3.4.2" "pillow==3.4.2"
PipInstall "py2exe 0.6.9" "py2exe_py2==0.6.9"
PipInstall "pycrypto 2.6.1" "pycrypto==2.6.1"
PipInstall "comtypes 1.1.3" "https://github.com/enthought/comtypes/archive/1.1.3.zip"
PipInstall "ctypeslib 0.5.6" "svn+http://svn.python.org/projects/ctypes/trunk/ctypeslib/#ctypeslib=0.5.6"
PipInstall "paramiko 2.2.1" "paramiko==2.2.1"
PipInstall "pywin32 223" pywin32==223
}
" "
"--- pywin32 post install"
$PywinPostInstall = $PythonScripts +"\pywin32_postinstall.py"
Start-Process python -Arg "$PywinPostInstall -install -silent -quiet" -Wait
" Done."
" "
"--- Inno Setup 5.6.1"
$InnoInstaller = $InstallersFolder + "innosetup-5.6.1-unicode.exe"
$InnoURL = "http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe"
Start-FileDownload $InnoURL -Timeout 60000 -FileName $InnoInstaller | ForEach-Object { Write-Host " " + $_ }
" Installing..."
Start-Process $InnoInstaller -Arg "/SP /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /RESTARTAPPLICATIONS /NOICONS" -NoNewWindow -Wait
" Done."
" "
" "
"=============== start the EventGhost build ==============="
" "
If ($Env:APPVEYOR_REPO_TAG.tolower() -eq "true" -and
$Env:APPVEYOR_REPO_TAG_NAME.tolower().startswith("deploy"))
{
# to do a release, create a tag in the form "Deploy_VERSION"
# VERSION must be a valid version string (without leading 'v')
# this tag will be deleted and a new release "vVERSION" created.
git checkout -q master
$release = $Env:APPVEYOR_REPO_TAG_NAME.split("_", 2)[1]
$url = if($Env:SFTP_URL){' --docs --url "' + $env:SFTP_URL + '"'} else {''}
python "_build\Build.py" --build --package --release --version $release $url
} Else {
# WIP
python "_build\Build.py" --build --package
.\EventGhost.exe -install
}
$Env:SetupExe = gci -recurse -filter "_build\output\*Setup.exe" -name
# update the appveyor build version to be the same as the EventGhost version
$start = $env:SetupExe.IndexOf("_")
$length = $env:SetupExe.LastIndexOf("_") - $start
$build_version = $env:SetupExe.Substring($start + 1, $length - 1)
Update-AppveyorBuild -Version "$build_version"
# Make sure the appveyor cache is only saved if our build was successfull
If (-Not (Test-Path(".\EventGhost.exe"))) {$env:APPVEYOR_CACHE_SKIP_SAVE = "true"}
" "
"=============== EventGhost build finished ==============="
" "
" "
build:
off
# If we don't turn build off, we get an error from appveyor telling us,
# we should decide, which project or solution file to use, because the
# folder contains more than one project or solution file.
# We don't really "build" (with a compiler), but Appveyor finds the
# solution files in the extension sub-directories and complains.
#after_test:
# - cmd: echo "=============== EventGhost build finished ==============="
# # - cmd: START /WAIT %setup-exe% /VERYSILENT /SUPPRESSMSGBOXES /NOCLOSEAPPLICATIONS
artifacts:
- path: _build\output\$(SetupExe)
name: $(SetupExe)
- path: _build\output\Build.log
name: Build.log
- path: _build\output\CHANGELOG.md
name: CHANGELOG.md
- path: _build\output\CHANGELOG_THIS_RELEASE.md
name: CHANGELOG_THIS_RELEASE.md
- path: _build\output\CHANGELOG_THIS_RELEASE.bb
name: CHANGELOG_THIS_RELEASE.bb
notifications:
- provider: GitHubPullRequest
template: >-
[{{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}})
Artifacts:
{{#jobs}}
{{#artifacts}}
[{{name}}]({{permalink}})
{{/artifacts}}
{{/jobs}}
on_build_success: true
on_build_failure: true
on_build_status_changed: false
- provider: Slack
incoming_webhook:
secure: jvFmrrWYdHWb5+Lou7xIXMvjZTjR4/o7YwVMeMBUPH3KKYti85fsycwk0GxveESFGlyxIPfgy3HwZDtb1xhaFlQJlvInvYXUpDfBZQHe4EM=
template: >-
<{{buildUrl}}|{{projectName}} {{buildVersion}} {{status}}>
Commit <{{commitUrl}}|{{commitId}}> by {{commitAuthor}} on {{commitDate}}:
Commit message: _{{commitMessage}}_
Artifacts:
{{#jobs}}{{#artifacts}}<{{permalink}}|{{name}}>
{{/artifacts}}{{/jobs}}
on_build_success: true
on_build_failure: true
on_build_status_changed: true
#on_finish:
# # Enable Remotedesktop and pause the build execution
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# notifications:
# - provider: GitHubPullRequest
# template: "{{#passed}}:white_check_mark: [Setup.exe](https://ci.appveyor.com/api/buildjobs/$(APPVEYOR_JOB_ID)/artifacts/_build%2Foutput%2F$(setup-exe)){{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}})"