Skip to content

Commit b998292

Browse files
committed
Temporary state
1 parent 4c57867 commit b998292

File tree

2 files changed

+28
-32
lines changed

2 files changed

+28
-32
lines changed

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

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
33
on: push
44

55
jobs:
6-
build-n-publish-pypi:
7-
name: Build and publish Python 🐍 distributions 📦 to PyPI
6+
build:
7+
name: Build the source package
88
runs-on: ubuntu-latest
9-
environment:
10-
name: pypi
11-
url: https://pypi.org/p/<package-name>
12-
permissions:
13-
id-token: write
14-
9+
1510
steps:
1611
- uses: actions/checkout@v3
1712
- name: Set up Python
@@ -28,11 +23,25 @@ jobs:
2823
run: >-
2924
python3 -m
3025
build
31-
--sdist
32-
--wheel
33-
--outdir dist/
34-
.
35-
# Actually publish to PyPI
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: python-package-distributions
30+
build-n-publish-pypi:
31+
name: Build and publish Python 🐍 distributions 📦 to PyPI
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/p/<package-name>
36+
permissions:
37+
id-token: write
38+
39+
steps:
40+
- name: Download all the dists
41+
uses: actions/download-artifact@v3
42+
with:
43+
name: python-package-distributions
44+
path: dist/
3645
- name: Publish distribution 📦 to PyPI
3746
if: startsWith(github.ref, 'refs/tags')
3847
uses: pypa/gh-action-pypi-publish@release/v1
@@ -46,25 +55,11 @@ jobs:
4655
id-token: write
4756

4857
steps:
49-
- uses: actions/checkout@v3
50-
- name: Set up Python
51-
uses: actions/setup-python@v4
58+
- name: Download all the dists
59+
uses: actions/download-artifact@v3
5260
with:
53-
python-version: "3.x"
54-
- name: Install pypa/build
55-
run: >-
56-
python3 -m
57-
pip install
58-
build
59-
--user
60-
- name: Build a binary wheel and a source tarball
61-
run: >-
62-
python3 -m
63-
build
64-
--sdist
65-
--wheel
66-
--outdir dist/
67-
.
61+
name: python-package-distributions
62+
path: dist/
6863
- name: Publish distribution 📦 to Test PyPI
6964
uses: pypa/gh-action-pypi-publish@release/v1
7065
with:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ Defining a workflow job environment
7979
===================================
8080

8181
We will have to define two jobs to publish to PyPI
82-
and TestPyPI respectively.
82+
and TestPyPI respectively, and an additional job to
83+
build the distribution packages.
8384

8485
Now, let's add initial setup for our job that will publish to PyPI.
8586
It's a process that will execute commands that we'll define later.

0 commit comments

Comments
 (0)