Skip to content

Commit

Permalink
Versioning and packaging added (#4)
Browse files Browse the repository at this point in the history
* Updating appveyor yml and setup.py for versioning

* Fixed typo

* Testing version number hypothesis

* Adding development semver with commit hash

* Adding artifact_on_tag_only and deploy config

* Try deleting artifacts

* Env vars not working correctly

* Clunky but hopefully working checks
  • Loading branch information
safijari authored Oct 18, 2018
1 parent 689264b commit bdb56dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
13 changes: 12 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
image: ubuntu

environment:
TWINE_PASS:
secure: l5f9zb54AYJ/kZgpYI2NGtktBACOM6jA1oQkrzz6wuI=

build_script:
- git submodule -q update --init
- sudo pip install cibuildwheel==0.10.0
- sh: CIBW_SKIP="*-manylinux1_i686" CIBW_ENVIRONMENT_LINUX="CMAKE_PREFIX_PATH=/work/opencv-3.4.3/build/install/" CIBW_PLATFORM=linux CIBW_MANYLINUX1_X86_64_IMAGE=safijari/manylinux-x64 cibuildwheel --output-dir wheelhouse
- CIBW_MANYLINUX1_X86_64_IMAGE=safijari/manylinux-x64 CIBW_PLATFORM=linux CIBW_SKIP="*-manylinux1_i686" CIBW_ENVIRONMENT_LINUX="CMAKE_PREFIX_PATH=/work/opencv-3.4.3/build/install/ APPVEYOR_REPO_COMMIT=$APPVEYOR_REPO_COMMIT APPVEYOR_REPO_TAG_NAME=$APPVEYOR_REPO_TAG_NAME" cibuildwheel --output-dir wheelhouse
- sh: |
[[ "$APPVEYOR_REPO_TAG" = "false" ]] && rm -rf wheelhouse/* || echo "Tagged build, not deleting artifacts"
artifacts:
- path: "wheelhouse\\*.whl"
name: Wheels

deploy_script:
- sh: sudo pip install -U twine
- sh: |
[[ "$APPVEYOR_REPO_TAG" = "true" && "$APPVEYOR_REPO_BRANCH" = "master" && -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]] && twine upload -u $TWINE_USER -p $TWINE_PASS wheelhouse/* || echo "Nothing to deploy"
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ def build_extension(self, ext):

version = 'dev'

if 'APPVEYOR_REPO_COMMIT' in os.environ:
version = 'APPVEYOR_REPO_COMMIT'
commit_var = 'APPVEYOR_REPO_COMMIT'
tag_name_var = 'APPVEYOR_REPO_TAG_NAME'

if 'APPVEYOR_REPO_TAG' and 'APPVEYOR_REPO_TAG_NAME' in os.environ:
version = os.environ['APPVEYOR_REPO_TAG_NAME']
if commit_var in os.environ and os.environ[commit_var]:
version = "0.0.0-" + os.environ[commit_var]

if tag_name_var in os.environ and os.environ[tag_name_var]:
version = os.environ[tag_name_var]

setup(
name='pyapriltags-eth',
Expand Down

0 comments on commit bdb56dd

Please sign in to comment.