Skip to content

Commit

Permalink
Update release procedure
Browse files Browse the repository at this point in the history
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
  • Loading branch information
natezb committed May 29, 2022
1 parent 0ec42d4 commit 61838f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- master
release:
types:
- published
- released
- prereleased

jobs:
build-n-publish:
Expand All @@ -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 }}
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ environment:
- PYTHON_VERSION: 3.10
MINICONDA: C:\Miniconda3

PYPIPASSWORD:
secure: ZTf9RSUmSv3iJLQGIvdJCJ/k5tSESQDomCCdahYSsDs=

init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"

Expand All @@ -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" )
14 changes: 13 additions & 1 deletion docs/release-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 61838f2

Please sign in to comment.