Skip to content

Commit 85bd3dd

Browse files
authored
Create publish.yml
adds a publishing workflow which will send the code to pypi
1 parent 200c9bd commit 85bd3dd

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
workflow_dispatch: {}
8+
push:
9+
branches:
10+
- main
11+
release:
12+
types:
13+
- published
14+
15+
jobs:
16+
dist:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: hynek/build-and-inspect-python-package@v2
24+
25+
publish:
26+
needs: [dist]
27+
environment: release
28+
permissions:
29+
id-token: write
30+
runs-on: ubuntu-latest
31+
if: github.event_name == 'release' && github.event.action == 'published'
32+
33+
steps:
34+
- uses: actions/download-artifact@v4
35+
with:
36+
name: Packages
37+
path: dist
38+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)