Skip to content

Commit b4fdd6b

Browse files
authored
Fix PyPI deployment (#129)
* Create PyPI-publish.yml * Delete .github/workflows/python-publish.yml
1 parent 069ac35 commit b4fdd6b

File tree

2 files changed

+61
-53
lines changed

2 files changed

+61
-53
lines changed

.github/workflows/PyPI-publish.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow will upload a Python Package to PyPI 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+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Build release distributions
30+
run: |
31+
python -m pip install build setuptools_scm
32+
python -m build
33+
34+
- name: Upload distributions
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: release-dists
38+
path: dist/
39+
40+
pypi-publish:
41+
runs-on: ubuntu-latest
42+
needs:
43+
- release-build
44+
permissions:
45+
id-token: write
46+
47+
environment:
48+
name: pypi
49+
url: https://pypi.org/project/bluetooth-2-usb/${{ github.event.release.name }}
50+
51+
steps:
52+
- name: Retrieve release distributions
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: release-dists
56+
path: dist/
57+
58+
- name: Publish release distributions to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1
60+
with:
61+
packages-dir: dist/

.github/workflows/python-publish.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)