Skip to content

Commit 56a2842

Browse files
authored
Create python-publish.yml
1 parent 334f07c commit 56a2842

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/python-publish.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
environment: release
23+
permissions:
24+
# mandatory for trusted publishing
25+
id-token: write
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Set up Python
30+
uses: actions/setup-python@v3
31+
with:
32+
python-version: '3.x'
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install build
37+
- name: Build package
38+
run: python -m build
39+
- name: Publish package
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
user: __token__
43+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)