From f97de80cc9ee6c81f07f8fab2e7d71b8a8516e12 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 4 Nov 2020 22:24:07 -0500 Subject: [PATCH 01/10] Migrate PyPI release to GitHub Actions --- .github/workflows/publish-to-pypi.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000000..fa76d70a062 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,35 @@ +name: Publish to PyPI + +on: push + +jobs: + publish-pypi: + name: Publish to PyPI + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install dependencies + run: pip install wheel + + - name: Build source distributions and wheels + run: python setup.py bdist_wheel + + - name: Publish to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} From 56b66b444cd2fbb482197810446700b414f24a9c Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 4 Nov 2020 22:52:41 -0500 Subject: [PATCH 02/10] Fetch all commit history --- .github/workflows/publish-to-pypi.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index fa76d70a062..a3d34706b02 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -9,7 +9,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@master + uses: actions/checkout@v2.3.4 + with: + # fecth all history so that versioneer works + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v1 From a51bdc68042bf957f409b12e51993b68aab4c678 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 5 Nov 2020 10:41:35 -0500 Subject: [PATCH 03/10] Update .github/workflows/publish-to-pypi.yml Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/publish-to-pypi.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a3d34706b02..0fecdd80480 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -22,8 +22,17 @@ jobs: - name: Install dependencies run: pip install wheel - - name: Build source distributions and wheels - run: python setup.py bdist_wheel + - name: Build source and wheel distributions + run: | + # Change the versioneer format to "pre" so that the commit hash isn't + # included (PyPI doesn't allow it). Can't do this permanently because + # we rely the hash to indicate to the tests that this is a local + # verison instead of a published version. + sed --in-place "s/pep440/pep440-pre/g" setup.cfg + python setup.py sdist bdist_wheel + echo "" + echo "Generated files:" + ls -lh dist/ - name: Publish to Test PyPI uses: pypa/gh-action-pypi-publish@master From 8d39c3669aeb2f1eda780715ee77065e4faede39 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 5 Nov 2020 10:54:25 -0500 Subject: [PATCH 04/10] Remove PyPI release job from Travis CI --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab57e494a9c..6a6ade63276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,6 @@ env: # Encrypted variables # GitHub Token for pushing the built docs (GH_TOKEN) - secure: "QII0477v0mmCCW3qSNXLCOtqraJaCICtSghiyrxYsuUdJTrXzXBNhX2KLIjcKYXOK1HdwYOFGf8xBVLl44clHlAW7R32ecEGeTJizr0yqTBvT3rNG1Xb7+E6jdXqrIs//PmPRaF8zOZxPl1SJKDK4jJpCx5HnAflg7wl/6tQLD6K3/dQ6FG2s3UKsc8o4qchOiEfxYhOuKo3j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I1cz20lJGL/MSi9bW1G7Uoidt3GXXWDmXrWt70vIXlLIxr8XV0Mu/rPbauGgWE+ZSYEfvdM5sP+FNF7vQ5de+Fkvzg5Z3tTfR+O1W+d7+vM4=" - TWINE_USERNAME=Leonardo.Uieda # The file with the listed requirements to be installed by conda - CONDA_REQUIREMENTS=requirements.txt @@ -60,12 +58,6 @@ script: - make -C doc all deploy: - # Make a release on PyPI - - provider: script - script: continuous-integration/travis/deploy-pypi.sh - on: - tags: true - condition: '$DEPLOY == "true"' # Push the built HTML in doc/_build/html to the gh-pages branch - provider: script script: continuous-integration/travis/deploy-gh-pages.sh From 7f2d4388f86ce47acd4f2365423d18d86b709a44 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 5 Nov 2020 20:22:09 -0500 Subject: [PATCH 05/10] Update the workflow --- .github/workflows/publish-to-pypi.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 0fecdd80480..8bb10fc4778 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,6 +1,15 @@ +# Workflow for publishing archives to PyPI name: Publish to PyPI -on: push +on: + # Runs for pull requests for testing purposes + pull_request: + branches: + - master + # Only runs for releases + release: + types: + - published jobs: publish-pypi: @@ -15,33 +24,38 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install dependencies - run: pip install wheel + run: python -m pip install setuptools wheel - - name: Build source and wheel distributions + - name: Fix up version string run: | # Change the versioneer format to "pre" so that the commit hash isn't # included (PyPI doesn't allow it). Can't do this permanently because # we rely the hash to indicate to the tests that this is a local # verison instead of a published version. + # + # The step is only necessary for testing purpose sed --in-place "s/pep440/pep440-pre/g" setup.cfg + + - name: Build source and wheel distributions + run: | python setup.py sdist bdist_wheel echo "" echo "Generated files:" ls -lh dist/ - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@v1.4.1 with: password: ${{ secrets.test_pypi_password }} repository_url: https://test.pypi.org/legacy/ - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@v1.4.1 with: password: ${{ secrets.pypi_password }} From 9d6212c1533ee5a4ff3f6bdaeaa3570184b33c85 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Nov 2020 14:07:54 -0500 Subject: [PATCH 06/10] Enable the workflow for pushes to master branch --- .github/workflows/publish-to-pypi.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 8bb10fc4778..f449e6b7c35 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,15 +1,19 @@ -# Workflow for publishing archives to PyPI +# Publish archives to PyPI and TestPyPI using GitHub Actions + name: Publish to PyPI +# Only run for pushes to the master branch and releases. on: - # Runs for pull requests for testing purposes - pull_request: + push: branches: - master - # Only runs for releases release: types: - published + # Runs for pull requests should be disable unless for testing purposes + pull_request: + branches: + - master jobs: publish-pypi: From 212134e8a249ae19a46388f7dae5dfb1192e6297 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Nov 2020 15:23:25 -0500 Subject: [PATCH 07/10] Update MAINTENANCE.md --- MAINTENANCE.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 0060289e26d..491037a1a87 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -47,7 +47,7 @@ conda and the `Makefile` to run the tests and checks. ### GitHub Actions -There are 3 configuration files located in `.github/workflows`: +There are 4 configuration files located in `.github/workflows`: 1. `ci_tests.yaml` (Style Checks, Tests on Linux/macOS/Windows) @@ -65,14 +65,20 @@ This is scheduled to run every Sunday at 12 noon. If new remote files are needed urgently, maintainers can manually uncomment the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache. +4. `publish-to-pypi.yml` (Publish archives to PyPI and TestPyPI) + +This workflow is ran to publish archives to PyPI and TestPyPI (for testing only). +Archives will be pushed to TestPyPI for every commit on the *master* branch and +tagged releases, and to PyPI for tagged releases only. + + ### Travis CI The configuration file is at `.travis.yml`. -Travis runs tests (Linux only) and handles all of our deployments automatically: +Travis runs tests (Linux only) and handles the documentation deployment automatically: * Updating the development documentation by pushing the built HTML pages from the *master* branch onto the `dev` folder of the *gh-pages* branch. -* Uploading new releases to PyPI (only when the build was triggered by a git tag). * Updated the `latest` documentation link to the new release. This way, most day-to-day maintenance operations are automatic. From 35d01ad9cb4867cd0b121173f20bb7781b74f1dd Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Nov 2020 15:23:49 -0500 Subject: [PATCH 08/10] Update .github/workflows/publish-to-pypi.yml Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/publish-to-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index f449e6b7c35..dc0d4953ef1 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -39,8 +39,8 @@ jobs: run: | # Change the versioneer format to "pre" so that the commit hash isn't # included (PyPI doesn't allow it). Can't do this permanently because - # we rely the hash to indicate to the tests that this is a local - # verison instead of a published version. + # we rely on the hash to tell the tests that this is a local version + # instead of a published version. # # The step is only necessary for testing purpose sed --in-place "s/pep440/pep440-pre/g" setup.cfg From 89bdac10c00b141188f739bf8fbcd42e38069fa9 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Nov 2020 15:37:09 -0500 Subject: [PATCH 09/10] Update MAINTENANCE.md Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- MAINTENANCE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 491037a1a87..9964a2a7f56 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -65,10 +65,10 @@ This is scheduled to run every Sunday at 12 noon. If new remote files are needed urgently, maintainers can manually uncomment the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache. -4. `publish-to-pypi.yml` (Publish archives to PyPI and TestPyPI) +4. `publish-to-pypi.yml` (Publish wheels to PyPI and TestPyPI) -This workflow is ran to publish archives to PyPI and TestPyPI (for testing only). -Archives will be pushed to TestPyPI for every commit on the *master* branch and +This workflow is ran to publish wheels to PyPI and TestPyPI (for testing only). +Archives will be pushed to TestPyPI on every commit to the *master* branch and tagged releases, and to PyPI for tagged releases only. From f9ec67601f9eb5e39194976cd77d2155b3667d64 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Nov 2020 15:44:55 -0500 Subject: [PATCH 10/10] Disable the workflow for pull requests --- .github/workflows/publish-to-pypi.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index dc0d4953ef1..84732cd89db 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -10,10 +10,10 @@ on: release: types: - published - # Runs for pull requests should be disable unless for testing purposes - pull_request: - branches: - - master + # Runs for pull requests should be disabled other than for testing purposes + #pull_request: + # branches: + # - master jobs: publish-pypi: