Skip to content

Commit 529cde5

Browse files
authored
Create python-publish.yml
1 parent 699b467 commit 529cde5

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- name: Check Git Version
19+
run: git --version
20+
- name: Set up Python
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: '3.11'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
- name: Build package
29+
run: |
30+
export PACKAGE_VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
31+
python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)