Skip to content

Commit 12a939b

Browse files
committed
Added python-publish.yml
1 parent 8eb611d commit 12a939b

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.10"
19+
20+
- name: Build release distributions
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install build
24+
python -m build
25+
26+
- name: Upload distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: release-dists
30+
path: dist/
31+
32+
pypi-publish:
33+
runs-on: ubuntu-latest
34+
needs:
35+
- release-build
36+
permissions:
37+
id-token: write
38+
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/project/fdir-cli/
42+
43+
steps:
44+
- name: Retrieve release distributions
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: release-dists
48+
path: dist/
49+
50+
- name: Publish release distributions to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)