Skip to content

Commit a6b1c1a

Browse files
authored
Added download/upload sample to README.md (#145)
Added upload example with artifact download
1 parent bf585e3 commit a6b1c1a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ jobs:
7272
- uses: hynek/build-and-inspect-python-package@v2
7373
```
7474
75+
To also upload to PyPI:
76+
77+
```yaml
78+
jobs:
79+
check-publish-package:
80+
name: Build, inspect, and upload our package to PyPI.
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: hynek/build-and-inspect-python-package@v2
86+
id: build
87+
- name: Download built artifact to dist/
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: ${{ steps.build.outputs.artifact-name }}
91+
path: dist
92+
- uses: pypa/gh-action-pypi-publish@release/v1
93+
```
94+
7595
If you’re using a VCS tag-based version extractor like [*setuptools-scm*] and need the built package to have the correct version, you must use *actions/checkout* with `fetch-depth: 0` – unless the latest commit _is_ the version tag.
7696

7797
> [!CAUTION]

0 commit comments

Comments
 (0)