Skip to content

Commit a6c2cbb

Browse files
authored
Configure GitHub actions to publish packages
1 parent 56302f8 commit a6c2cbb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/pypi-release

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
jobs:
2+
build_sdist:
3+
name: Build Python source distribution
4+
runs-on: ubuntu-latest
5+
steps:
6+
- uses: actions/checkout@v3
7+
8+
- name: Build sdist
9+
run: pipx run build --sdist
10+
11+
- uses: actions/upload-artifact@v3
12+
with:
13+
path: dist/*.tar.gz
14+
15+
pypi-publish:
16+
name: Upload release to PyPI
17+
if: github.event_name == 'release' && github.event.action == 'published'
18+
needs:
19+
- build_sdist
20+
runs-on: ubuntu-latest
21+
environment:
22+
name: pypi
23+
url: https://pypi.org/p/pysolr
24+
permissions:
25+
id-token: write
26+
steps:
27+
- uses: actions/download-artifact@v3
28+
with:
29+
# unpacks default artifact into dist/
30+
# if `name: artifact` is omitted, the action will create extra parent dir
31+
name: artifact
32+
path: dist
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)