From 61838f2da9fceb53d22e1fbf52023da09ba7dabf Mon Sep 17 00:00:00 2001 From: Nate Bogdanowicz Date: Sun, 29 May 2022 13:18:44 -0700 Subject: [PATCH] Update release procedure Revert the PyPI GitHub Action and document how to use it. It is tricky because it doesn't work with drafts, but it's known to work. Also remove AppVeyor's deploy script --- .github/workflows/pypi.yml | 7 ++++--- appveyor.yml | 23 ----------------------- docs/release-instructions.rst | 14 +++++++++++++- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index cf05d64b..5cd02941 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -6,7 +6,8 @@ on: - master release: types: - - published + - released + - prereleased jobs: build-n-publish: @@ -32,14 +33,14 @@ jobs: bdist_wheel - name: Publish to TestPyPI - if: ${{ github.event_name == 'release' && (github.event.release.prerelease || github.event.release.draft) }} + if: ${{ github.event_name == 'release' && github.event.action == 'prereleased' }} uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - name: Publish to PyPI - if: ${{ github.event_name == 'release' && ! (github.event.release.prerelease || github.event.release.draft) }} + if: ${{ github.event_name == 'release' && github.event.action == 'released' }} uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/appveyor.yml b/appveyor.yml index b020f065..01fbbc50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,9 +9,6 @@ environment: - PYTHON_VERSION: 3.10 MINICONDA: C:\Miniconda3 - PYPIPASSWORD: - secure: ZTf9RSUmSv3iJLQGIvdJCJ/k5tSESQDomCCdahYSsDs= - init: - "ECHO %PYTHON_VERSION% %MINICONDA%" @@ -28,23 +25,3 @@ install: test_script: - conda install pytest - py.test - -deploy_script: - - pip install twine - - - echo [distutils] > %USERPROFILE%\\.pypirc - - echo index-servers = >> %USERPROFILE%\\.pypirc - - echo pypi >> %USERPROFILE%\\.pypirc - - echo [pypi] >> %USERPROFILE%\\.pypirc - - echo repository = https://pypi.python.org/pypi >> %USERPROFILE%\\.pypirc - - echo username = natezb >> %USERPROFILE%\\.pypirc - - echo password = %PYPIPASSWORD% >> %USERPROFILE%\\.pypirc - - # Ensure setup.py finds .pypirc - - set HOME=%USERPROFILE% - - # Don't do an sdist, since TravisCI handles that - - python setup.py bdist_wheel - - # Only upload if tagged - - if "%APPVEYOR_REPO_TAG%"=="true" ( twine upload --skip-existing -r pypi dist/* ) else ( echo "Not deploying untagged commit" ) diff --git a/docs/release-instructions.rst b/docs/release-instructions.rst index bf984330..5b38521c 100644 --- a/docs/release-instructions.rst +++ b/docs/release-instructions.rst @@ -15,5 +15,17 @@ Here's some info on what needs to be done before each release: - Commit and push these changes - Wait to verify that the builds, tests, and documentation builds all succeed - Tag the commit with the version number and push the tag + + - ``git tag -m "Release 0.x" 0.x`` + - ``git push --tags`` + - Set up the release info on GitHub -- Verify that Travis CI and AppVeyor have successfully deployed to PyPI + + - Go to releases, "Draft a new release" + - Choose the newly pushed tag + - Copy in the CHANGELOG section for this release, convert headings to use ``###`` + - Check "This is a pre-release" + - Click "Publish release" (DO NOT save as a draft. This will mess up the Github Actions you'll never publish to TestPyPI) + - Wait for PyPI GitHub action to run, verify upload succeeded + - Uncheck "This is a pre-release" and re-publish + - Verify that the PyPI GitHub action has deployed to the real PyPI