Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit 4bd1c31

Browse files
authored
Create python-publish.yml
1 parent fa7928c commit 4bd1c31

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/python-publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
pypi-publish:
20+
21+
runs-on: ubuntu-latest
22+
23+
environment:
24+
name: pypi
25+
url: https://pypi.org/p/<your-pypi-project-name>
26+
permissions:
27+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Set up Python
32+
uses: actions/setup-python@v3
33+
with:
34+
python-version: '3.x'
35+
- name: Install dependencies
36+
run: |
37+
python3 -m pip install --upgrade pip
38+
pip install build
39+
- name: Build package
40+
run: python3 -m build
41+
- name: Publish package
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
# with:
44+
# user: __token__
45+
# password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)