Skip to content

Commit 2bc6ab5

Browse files
author
Aaron Madison
committed
Peripheral: Trying to use updated build and publish methods
1 parent 2d7d819 commit 2bc6ab5

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed
Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
# This workflow will upload a Python Package using trusted publishers
2+
# For more information see: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
33

44
name: Upload Python Package
55

@@ -9,23 +9,27 @@ on:
99

1010
jobs:
1111
deploy:
12-
1312
runs-on: ubuntu-latest
1413

14+
permissions:
15+
id-token: write # This is important for OIDC
16+
contents: read # Recommended for checkout
17+
1518
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
19+
- uses: actions/checkout@v5
20+
- name: Set up Python
21+
uses: actions/setup-python@v6
22+
with:
23+
python-version: '3.x'
24+
- name: Install pypa/build
25+
run: |
26+
python -m pip install build --user
27+
- name: Build Package
28+
run: python -m build
29+
- name: Publish to Pypi
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
# This action handles building and publishing automatically
33+
# No need to manually run setup.py or twine
34+
# No secrets needed here for PyPI username/password
35+
# The action will use the OIDC token from the permissions block

0 commit comments

Comments
 (0)