Skip to content

Commit 61838f2

Browse files
committed
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
1 parent 0ec42d4 commit 61838f2

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

.github/workflows/pypi.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- master
77
release:
88
types:
9-
- published
9+
- released
10+
- prereleased
1011

1112
jobs:
1213
build-n-publish:
@@ -32,14 +33,14 @@ jobs:
3233
bdist_wheel
3334
3435
- name: Publish to TestPyPI
35-
if: ${{ github.event_name == 'release' && (github.event.release.prerelease || github.event.release.draft) }}
36+
if: ${{ github.event_name == 'release' && github.event.action == 'prereleased' }}
3637
uses: pypa/gh-action-pypi-publish@master
3738
with:
3839
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
3940
repository_url: https://test.pypi.org/legacy/
4041

4142
- name: Publish to PyPI
42-
if: ${{ github.event_name == 'release' && ! (github.event.release.prerelease || github.event.release.draft) }}
43+
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
4344
uses: pypa/gh-action-pypi-publish@master
4445
with:
4546
password: ${{ secrets.PYPI_API_TOKEN }}

appveyor.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ environment:
99
- PYTHON_VERSION: 3.10
1010
MINICONDA: C:\Miniconda3
1111

12-
PYPIPASSWORD:
13-
secure: ZTf9RSUmSv3iJLQGIvdJCJ/k5tSESQDomCCdahYSsDs=
14-
1512
init:
1613
- "ECHO %PYTHON_VERSION% %MINICONDA%"
1714

@@ -28,23 +25,3 @@ install:
2825
test_script:
2926
- conda install pytest
3027
- py.test
31-
32-
deploy_script:
33-
- pip install twine
34-
35-
- echo [distutils] > %USERPROFILE%\\.pypirc
36-
- echo index-servers = >> %USERPROFILE%\\.pypirc
37-
- echo pypi >> %USERPROFILE%\\.pypirc
38-
- echo [pypi] >> %USERPROFILE%\\.pypirc
39-
- echo repository = https://pypi.python.org/pypi >> %USERPROFILE%\\.pypirc
40-
- echo username = natezb >> %USERPROFILE%\\.pypirc
41-
- echo password = %PYPIPASSWORD% >> %USERPROFILE%\\.pypirc
42-
43-
# Ensure setup.py finds .pypirc
44-
- set HOME=%USERPROFILE%
45-
46-
# Don't do an sdist, since TravisCI handles that
47-
- python setup.py bdist_wheel
48-
49-
# Only upload if tagged
50-
- if "%APPVEYOR_REPO_TAG%"=="true" ( twine upload --skip-existing -r pypi dist/* ) else ( echo "Not deploying untagged commit" )

docs/release-instructions.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,17 @@ Here's some info on what needs to be done before each release:
1515
- Commit and push these changes
1616
- Wait to verify that the builds, tests, and documentation builds all succeed
1717
- Tag the commit with the version number and push the tag
18+
19+
- ``git tag -m "Release 0.x" 0.x``
20+
- ``git push --tags``
21+
1822
- Set up the release info on GitHub
19-
- Verify that Travis CI and AppVeyor have successfully deployed to PyPI
23+
24+
- Go to releases, "Draft a new release"
25+
- Choose the newly pushed tag
26+
- Copy in the CHANGELOG section for this release, convert headings to use ``###``
27+
- Check "This is a pre-release"
28+
- Click "Publish release" (DO NOT save as a draft. This will mess up the Github Actions you'll never publish to TestPyPI)
29+
- Wait for PyPI GitHub action to run, verify upload succeeded
30+
- Uncheck "This is a pre-release" and re-publish
31+
- Verify that the PyPI GitHub action has deployed to the real PyPI

0 commit comments

Comments
 (0)