Skip to content

Commit 51ae908

Browse files
authored
Modernize publish workflow (#23)
1 parent d85f7da commit 51ae908

File tree

3 files changed

+53
-67
lines changed

3 files changed

+53
-67
lines changed

.github/workflows/build-package.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflows 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
3+
name: Upload Python Package
4+
5+
on:
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
build:
11+
name: Build distribution 📦
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.x"
20+
- name: Install pypa/build
21+
run: >-
22+
python3 -m
23+
pip install
24+
build
25+
--user
26+
- name: Build a binary wheel and a source tarball
27+
run: python3 -m build
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
deploy:
35+
permissions:
36+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
37+
runs-on: ubuntu-latest
38+
needs:
39+
- build
40+
name: >-
41+
Publish Python 🐍 distribution 📦 to PyPI
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/pyserial-asyncio-fast
45+
46+
steps:
47+
- name: Download all the dists
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
- name: Publish package distributions to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release-to-pypi.yml

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

0 commit comments

Comments
 (0)