Skip to content

Commit

Permalink
fix automatic windows deploy
Browse files Browse the repository at this point in the history
Now, when an appveyor builds succeeds on the master branch (when a merge
is done), a draft release is automatically created on github with an
uploaded zip file containing the windows build.
  • Loading branch information
fgoudreault committed Jul 20, 2017
1 parent 6109a40 commit 3b18f42
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
26 changes: 16 additions & 10 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
build: false

environment:
matrix:
- PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda36
init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"
- "ECHO %APPVEYOR_REPO_TAG_NAME%"
install:
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- conda update --yes conda
Expand All @@ -14,19 +13,26 @@ install:
- python setup.py develop
test_script:
- python tests.py
branches:
only:
- master
- develop
before_deploy:
# build is done in build_script
build: off
build_script:
- python build.py bdist_msi
artifacts:
- path: auxiclean_windows.zip
name: auxiclean_windows

# deploy only when making a new release on master branch
# the windows build will be uploaded into the new release.
deploy:
release: $(appveyor_build_version)
description: "Release description"
appveyor_repo_tag: true
tag: $(APPVEYOR_REPO_TAG_NAME)
relsease: $(APPVEYOR_REPO_TAG_NAME)
description: ""
provider: GitHub
force_update: false
auth_token:
secure: x2ous7RX857j64h4DSkiEBCSU8kUQYCL31UBrPLUSgosixVS/XDXGA6TWr0DLPm9
artifact: auxiclean.zip
artifact: auxiclean_windows
draft: true
on:
branch: master
Expand Down
9 changes: 6 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@

executables = [Executable("run.py", base=base, targetName="auxiclean.exe")]
version = versioneer.get_version()
short = version[:version.find("+")].strip("v")
short = version.strip("v")
if "+" in version:
short = version[:version.find("+")].strip("v")
setupcx(name="auxiclean",
version=short,
executables=executables,
options={"build_exe": {"include_files": include_files}})
options={"build_exe": {"include_files": include_files,
"silent": True}})

# find directory and zip it
dirs = os.listdir("build")
Expand All @@ -44,4 +47,4 @@
break
if tozip is None:
raise FileNotFoundError("build directory not found")
shutil.make_archive("auxiclean", "zip", tozip)
shutil.make_archive("auxiclean_windows", "zip", tozip)

0 comments on commit 3b18f42

Please sign in to comment.