-
-
Notifications
You must be signed in to change notification settings - Fork 60
👷📦🚀 Enable Travis CI to publish dists to PYPI #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
354abdf
👷📦🚀 Enable Travis CI to publish dists to PYPI
webknjaz 998af76
Move job conditions to mixtures
webknjaz ce8dddc
Make test matrix explicit
webknjaz 998785a
Test only related project when releasing to PYPI
webknjaz 9848285
Opt-in for better conditions support
webknjaz 58180db
Uppercase OR in if-clauses
webknjaz 970d7d5
Add project markers via env vars
webknjaz 64daaa1
Move creation of hacky stub to before_deploy
webknjaz 23ee67b
Split deployment configs for blurb / cherry-picker
webknjaz 931f0c3
Make better use of env var for prj distinction
webknjaz fddf8dc
Add core-workflow encrypted password
Mariatta 70dfcc4
PYPI -> PyPI
Mariatta 1e560b0
temporary disable publishing blurb
webknjaz 681c591
Drop unnecessary deploy customizations for blurb
webknjaz 318f920
Drop unnecessary TODO comments
webknjaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,101 @@ | ||
conditions: v1 | ||
|
||
language: python | ||
python: | ||
- "3.5" | ||
- "3.6-dev" | ||
- "3.7-dev" | ||
- "nightly" | ||
|
||
dist: trusty | ||
sudo: false | ||
cache: pip | ||
|
||
before_install: | ||
- pip install --upgrade flit | ||
install: | ||
- pushd blurb | ||
- flit install | ||
- popd | ||
script: | ||
- blurb test | ||
|
||
.mixtures: | ||
- &run-if-tagged | ||
if: tag IS present | ||
- &run-if-cherry-picker | ||
if: tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$ | ||
- &run-if-blurb | ||
if: tag =~ ^blurb\-v\d+\.\d+\.\d+$ | ||
- &run-if-cherry-picker-or-untagged | ||
if: tag IS NOT present OR tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$ | ||
- &run-if-blurb-or-untagged | ||
if: tag IS NOT present OR tag =~ ^blurb\-v\d+\.\d+\.\d+$ | ||
- &install-and-test-cherry-picker | ||
<<: *run-if-cherry-picker-or-untagged | ||
env: | ||
TARGET_PKG: cherry_picker | ||
install: | ||
- pushd cherry_picker | ||
- &cd-to-project pushd "$TARGET_PKG" | ||
- flit install | ||
- popd | ||
script: | ||
- pushd cherry_picker | ||
- pytest cherry_picker/test.py -v | ||
- popd | ||
- &install-and-test-blurb | ||
<<: *run-if-blurb-or-untagged | ||
env: | ||
TARGET_PKG: blurb | ||
install: | ||
- *cd-to-project | ||
- flit install | ||
- popd | ||
script: | ||
- blurb test | ||
- &deploy-base | ||
stage: Publish dists to PYPI | ||
<<: *run-if-tagged | ||
python: "3.6-dev" | ||
install: | ||
- *cd-to-project | ||
script: | ||
- flit build | ||
before_deploy: | ||
# Add an empty setup.py stub, because pypi provider always calls it | ||
- touch setup.py | ||
deploy: &deployment-config | ||
provider: pypi | ||
# `skip-cleanup: true` is required to preserve binary wheel and sdist, | ||
# built by during `install` step above. | ||
skip-cleanup: true | ||
# `skip-existing: true` is required to skip uploading dists, already | ||
# present in PyPI instead of failing the whole process. | ||
# This happenes when other CI (AppVeyor etc.) has already uploaded | ||
# the very same dist (usually sdist). | ||
skip-existing: true | ||
user: &pypi-user core-workflow | ||
password: &pypi-password | ||
# Encrypt with `travis encrypt -r python/core-workflow --org` while using travis-ci.org; | ||
# change to `travis encrypt -r python/core-workflow --api-endpoint 'https://api.travis-ci.com/'` | ||
# upon switch to __free__ travis-ci.com: | ||
secure: "bg1ZOOHlhaT+S3TQy2WpSsWekHaeZSq39kkZj/Ql3nvJ0ES+a+lTjk+gmuSnSX0Sf9V+88TdN5g1frYVcvYWwIQvLEQP2xhqIfq8K+MVe+GbshQGiTD4PC4f7vRcDY+B93X7cQ8HgkGho3c0/BaEaK6MtrS8WK7dIdHCPaea5D8rLF9jXtS2Lt8MYtqRDG1R2BsNN+o87eyr3qD3aJW6cFRPTHPr/x+gmlKuIJcVOwuVd4xyR701xRpE7hK5/bKvQwI2QZhD7wTyJwYqsl3Ce/ZlyS+IINktkFhD2BqH2ya4tdOHeVhA+b44eJEDXUR7gweyO+Ein5W3S3R2lDxHuX3Aq7nJBKHxU39kwcnPPaMRWYKey51d9zbIicmxjj5sLY0vPYmlX1zdbDUK9NqkdRf8aLzyowWFl3DtkXmyoakITOz9boqDIRiivTJQ/mLG8AFKgf0ms/z1yW4/PN+LoomdpmhQj05EfAJdAvdTw+ceteaeBSKc2uDql4Qj5AKUddeaoLQuPbWForfSPosv9DZZmvOXrmncY91HngrdclxFIssMtefQrC2USbQEIedih1cxfsXzwBrX7+f4eHH2MJt/GrOyNB0gaXc4sikYkaBKsIg7UCWC1/F4jmGkyDLlwp31zflZkjPKUJ3vp2SC9R6sHcT04tvxTVIMDCJgkc8=" | ||
on: | ||
tags: true | ||
all_branches: true | ||
|
||
jobs: | ||
include: | ||
- python: "3.5" | ||
<<: *install-and-test-blurb | ||
- python: "3.6-dev" | ||
<<: *install-and-test-blurb | ||
- python: "3.7-dev" | ||
<<: *install-and-test-blurb | ||
- python: "nightly" | ||
<<: *install-and-test-blurb | ||
|
||
- python: "3.6-dev" | ||
<<: *install-and-test-cherry-picker | ||
- python: "3.7-dev" | ||
<<: *install-and-test-cherry-picker | ||
- python: "nightly" | ||
<<: *install-and-test-cherry-picker | ||
|
||
- <<: *deploy-base | ||
<<: *run-if-cherry-picker | ||
env: | ||
TARGET_PKG: cherry_picker | ||
|
||
- <<: *deploy-base | ||
<<: *run-if-blurb | ||
if: false | ||
env: | ||
TARGET_PKG: blurb |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mariatta I'm a bit concerned about restricting this to
vX.Y.Z
format, while in real life there might be some extensions (dev/a/b). Should I extend this regexp to take those into account?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave the regex as is (handling vX.Y.Z) and when the need arise we can adjust it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I just thought of a common use case for testing pre-releases when you are unsure whether build artifact (dist) is correct.