Skip to content

Commit 5668ae8

Browse files
authored
Merge pull request #1092 from henryiii/henryiii/fix/ghaguide
chore: update GHA guide
2 parents 84b97b1 + a4f8a0e commit 5668ae8

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

source/guides/github-actions-ci-cd-sample/publish-to-test-pypi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@master
12-
- name: Set up Python 3.10
13-
uses: actions/setup-python@v3
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
1414
with:
15-
python-version: "3.10"
15+
python-version: "3.x"
1616
- name: Install pypa/build
1717
run: >-
1818
python -m

source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ It will use the `pypa/gh-action-pypi-publish GitHub Action`_.
1212

1313
.. attention::
1414

15-
This guide *assumes* that you already have a project that
16-
you know how to build distributions for and *it lives on GitHub*.
15+
This guide *assumes* that you already have a project that you know how to
16+
build distributions for and *it lives on GitHub*. This guide also avoids
17+
details of building platform specific projects. If you have binary
18+
components, check out :ref:`cibuildwheel`'s GitHub Action examples.
1719

1820
Saving credentials on GitHub
1921
============================
@@ -94,21 +96,21 @@ This will download your repository into the CI runner and then
9496
install and activate Python 3.10.
9597

9698
And now we can build dists from source. In this example, we'll
97-
use ``build`` package, assuming that your project has a
98-
``pyproject.toml`` properly set up (see
99-
:pep:`517`/:pep:`518`).
99+
use ``build`` package.
100100

101101
.. tip::
102102

103103
You can use any other method for building distributions as long as
104104
it produces ready-to-upload artifacts saved into the
105-
``dist/`` folder.
105+
``dist/`` folder. You can even use ``actions/upload-artifact`` and
106+
``actions/download-artifact`` to tranfer files between jobs or make them
107+
accessable for download from the web CI interface.
106108

107109
So add this to the steps list:
108110

109111
.. literalinclude:: github-actions-ci-cd-sample/publish-to-test-pypi.yml
110112
:language: yaml
111-
:start-after: version: "3.10"
113+
:start-after: version: "3.x"
112114
:end-before: Actually publish to PyPI/TestPyPI
113115

114116

@@ -124,7 +126,9 @@ Finally, add the following steps at the end:
124126
These two steps use the `pypa/gh-action-pypi-publish`_ GitHub
125127
Action: the first one uploads contents of the ``dist/`` folder
126128
into TestPyPI unconditionally and the second does that to
127-
PyPI, but only if the current commit is tagged.
129+
PyPI, but only if the current commit is tagged. It is recommended
130+
you use the latest release tag; a tool like GitHub's dependabot can keep
131+
these updated regularly.
128132

129133

130134
That's all, folks!

0 commit comments

Comments
 (0)