From 354abdf0b7bb81dfe0f6063f2ea9957f30f2f790 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 11 Jun 2018 00:26:32 +0200 Subject: [PATCH 01/15] =?UTF-8?q?=F0=9F=91=B7=F0=9F=93=A6=F0=9F=9A=80=20En?= =?UTF-8?q?able=20Travis=20CI=20to=20publish=20dists=20to=20PYPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #222 @Mariatta still needs to update secret --- .travis.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2b69003..7b201cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +version: = 0 + language: python python: - "3.5" @@ -28,6 +30,34 @@ script: - pushd cherry_picker - pytest cherry_picker/test.py -v - popd +- &deploy-base + stage: Publish dists to PYPI + if: tag IS present + python: "3.6-dev" + script: + - flit build + # Add an empty setup.py stub, because pypi provider always calls it + - touch setup.py + deploy: + 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: Mariatta # TODO: consider having a separate "uploader user" + # with reduced priviliges for security reasons + 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: PLACE_YOUR_ENCRYPTED_PASSWORD_HERE + on: + tags: true + all_branches: true jobs: include: - python: "3.6-dev" @@ -36,3 +66,17 @@ jobs: <<: *install-and-test-cherry-picker - python: "nightly" <<: *install-and-test-cherry-picker + + - <<: *deploy-base + if: tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$ + env: + TARGET_PKG: cherry-picker + install: + - pushd cherry_picker + + - <<: *deploy-base + if: tag =~ ^blurb\-v\d+\.\d+\.\d+$ + env: + TARGET_PKG: blurb + install: + - pushd blurb From 998af767a3c4b6cc2b99f182621907c4963232d8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 17:50:40 +0200 Subject: [PATCH 02/15] Move job conditions to mixtures --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b201cd..ac619a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,12 @@ 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+$ - &install-and-test-cherry-picker install: - pushd cherry_picker @@ -32,7 +38,7 @@ script: - popd - &deploy-base stage: Publish dists to PYPI - if: tag IS present + <<: *run-if-tagged python: "3.6-dev" script: - flit build @@ -68,14 +74,14 @@ jobs: <<: *install-and-test-cherry-picker - <<: *deploy-base - if: tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$ + <<: *run-if-cherry-picker env: TARGET_PKG: cherry-picker install: - pushd cherry_picker - <<: *deploy-base - if: tag =~ ^blurb\-v\d+\.\d+\.\d+$ + <<: *run-if-blurb env: TARGET_PKG: blurb install: From ce8dddcc539cb2e7fa3a5b1f8fcd88af967c4d52 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 17:56:08 +0200 Subject: [PATCH 03/15] Make test matrix explicit --- .travis.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac619a8..e7a39a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,6 @@ version: = 0 language: python -python: -- "3.5" -- "3.6-dev" -- "3.7-dev" -- "nightly" dist: trusty sudo: false @@ -13,12 +8,6 @@ cache: pip before_install: - pip install --upgrade flit -install: -- pushd blurb -- flit install -- popd -script: -- blurb test .mixtures: - &run-if-tagged @@ -31,11 +20,16 @@ script: install: - pushd cherry_picker - flit install - - popd script: - - pushd cherry_picker - pytest cherry_picker/test.py -v - popd +- &install-and-test-blurb + install: + - pushd blurb + - flit install + - popd + script: + - blurb test - &deploy-base stage: Publish dists to PYPI <<: *run-if-tagged @@ -64,8 +58,18 @@ script: 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" From 998785a10b56992b26d5277d42cc33038ec0232d Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 17:59:29 +0200 Subject: [PATCH 04/15] Test only related project when releasing to PYPI --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index e7a39a5..85e9779 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,12 @@ before_install: 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 install: - pushd cherry_picker - flit install @@ -24,6 +29,7 @@ before_install: - pytest cherry_picker/test.py -v - popd - &install-and-test-blurb + <<: *run-if-blurb-or-untagged install: - pushd blurb - flit install From 98482858839f4dc6f66bf6f646d12d33d7e6e815 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 18:16:24 +0200 Subject: [PATCH 05/15] Opt-in for better conditions support --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 85e9779..2687882 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -version: = 0 +conditions: v1 language: python From 58180dba789d445c65692f8dd2e912996ccc1018 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 18:20:10 +0200 Subject: [PATCH 06/15] Uppercase OR in if-clauses --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2687882..05c9330 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,9 @@ before_install: - &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+$ + 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+$ + if: tag IS NOT present OR tag =~ ^blurb\-v\d+\.\d+\.\d+$ - &install-and-test-cherry-picker <<: *run-if-cherry-picker-or-untagged install: From 970d7d50c058998273dbeba616f8028f3c442f58 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 18:22:47 +0200 Subject: [PATCH 07/15] Add project markers via env vars --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 05c9330..55074b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ before_install: if: tag IS NOT present OR tag =~ ^blurb\-v\d+\.\d+\.\d+$ - &install-and-test-cherry-picker <<: *run-if-cherry-picker-or-untagged + env: + PROJECT: cherry-picker install: - pushd cherry_picker - flit install @@ -30,6 +32,8 @@ before_install: - popd - &install-and-test-blurb <<: *run-if-blurb-or-untagged + env: + PROJECT: blurb install: - pushd blurb - flit install From 64daaa1310ca8f8cbf987413400e226588ba5c98 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Jul 2018 18:23:39 +0200 Subject: [PATCH 08/15] Move creation of hacky stub to before_deploy --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 55074b5..dd59b1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,7 @@ before_install: python: "3.6-dev" script: - flit build + before_deploy: # Add an empty setup.py stub, because pypi provider always calls it - touch setup.py deploy: From 23ee67bf75d4092ec7d7773176bc4b25a6835156 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 17 Jul 2018 10:58:27 +0200 Subject: [PATCH 09/15] Split deployment configs for blurb / cherry-picker --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd59b1c..d845f06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ before_install: before_deploy: # Add an empty setup.py stub, because pypi provider always calls it - touch setup.py - deploy: + deploy: &deployment-config provider: pypi # `skip-cleanup: true` is required to preserve binary wheel and sdist, # built by during `install` step above. @@ -59,9 +59,9 @@ before_install: # This happenes when other CI (AppVeyor etc.) has already uploaded # the very same dist (usually sdist). skip-existing: true - user: Mariatta # TODO: consider having a separate "uploader user" - # with reduced priviliges for security reasons - password: + user: &pypi-user Mariatta # TODO: consider having a separate "uploader user" + # with reduced priviliges for security reasons + 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: @@ -101,3 +101,8 @@ jobs: TARGET_PKG: blurb install: - pushd blurb + deploy: + <<: *deployment-config + user: *pypi-user # TODO: consider having a separate "uploader user" + # with reduced priviliges for security reasons + password: *pypi-password # FIXME: might need to change user/password pair From 931f0c37c8d50dcc84b079a33675c01537ab4f68 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 17 Jul 2018 11:01:29 +0200 Subject: [PATCH 10/15] Make better use of env var for prj distinction --- .travis.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d845f06..34e3e6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,9 @@ before_install: - &install-and-test-cherry-picker <<: *run-if-cherry-picker-or-untagged env: - PROJECT: cherry-picker + TARGET_PKG: cherry_picker install: - - pushd cherry_picker + - &cd-to-project pushd "$TARGET_PKG" - flit install script: - pytest cherry_picker/test.py -v @@ -33,9 +33,9 @@ before_install: - &install-and-test-blurb <<: *run-if-blurb-or-untagged env: - PROJECT: blurb + TARGET_PKG: blurb install: - - pushd blurb + - *cd-to-project - flit install - popd script: @@ -44,6 +44,8 @@ before_install: stage: Publish dists to PYPI <<: *run-if-tagged python: "3.6-dev" + install: + - *cd-to-project script: - flit build before_deploy: @@ -91,16 +93,12 @@ jobs: - <<: *deploy-base <<: *run-if-cherry-picker env: - TARGET_PKG: cherry-picker - install: - - pushd cherry_picker + TARGET_PKG: cherry_picker - <<: *deploy-base <<: *run-if-blurb env: TARGET_PKG: blurb - install: - - pushd blurb deploy: <<: *deployment-config user: *pypi-user # TODO: consider having a separate "uploader user" From fddf8dcc495c17356eb8855af5b4766257d2e76d Mon Sep 17 00:00:00 2001 From: Mariatta Date: Fri, 3 Aug 2018 14:53:11 -0700 Subject: [PATCH 11/15] Add core-workflow encrypted password --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 34e3e6b..be0d33e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,13 +61,13 @@ before_install: # This happenes when other CI (AppVeyor etc.) has already uploaded # the very same dist (usually sdist). skip-existing: true - user: &pypi-user Mariatta # TODO: consider having a separate "uploader user" + user: &pypi-user core-workflow # TODO: consider having a separate "uploader user" # with reduced priviliges for security reasons 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: PLACE_YOUR_ENCRYPTED_PASSWORD_HERE + 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 From 70dfcc4224122e1dfb00cf583ed7d52359cb73cb Mon Sep 17 00:00:00 2001 From: Mariatta Date: Fri, 3 Aug 2018 14:56:46 -0700 Subject: [PATCH 12/15] PYPI -> PyPI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be0d33e..650610b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ before_install: # 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. + # 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 From 1e560b0f3ace60270dc729f85fc8b8403f6db721 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 4 Aug 2018 00:07:37 +0200 Subject: [PATCH 13/15] temporary disable publishing blurb --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 650610b..faf87c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,6 +97,7 @@ jobs: - <<: *deploy-base <<: *run-if-blurb + if: false env: TARGET_PKG: blurb deploy: From 681c5912afbbb0b59bd1d57e4c8f8075fd9179d4 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 4 Aug 2018 00:09:21 +0200 Subject: [PATCH 14/15] Drop unnecessary deploy customizations for blurb --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index faf87c1..7a21498 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,8 +100,3 @@ jobs: if: false env: TARGET_PKG: blurb - deploy: - <<: *deployment-config - user: *pypi-user # TODO: consider having a separate "uploader user" - # with reduced priviliges for security reasons - password: *pypi-password # FIXME: might need to change user/password pair From 318f92054f087223550abf374deb113ce3ed9c1b Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 4 Aug 2018 00:09:56 +0200 Subject: [PATCH 15/15] Drop unnecessary TODO comments --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a21498..b12345b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,8 +61,7 @@ before_install: # This happenes when other CI (AppVeyor etc.) has already uploaded # the very same dist (usually sdist). skip-existing: true - user: &pypi-user core-workflow # TODO: consider having a separate "uploader user" - # with reduced priviliges for security reasons + 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/'`