Skip to content

Commit fbe8d1e

Browse files
committed
Add GitHub Actions trusted publishing workflow for PyPI
1 parent ff2119e commit fbe8d1e

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish to PyPI
2+
3+
env:
4+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
name: Build distribution artifacts
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install build tooling
28+
run: python -m pip install --upgrade build
29+
30+
- name: Build sdist and wheel
31+
run: python -m build
32+
33+
- name: Upload distribution artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dist
37+
path: dist/
38+
39+
publish:
40+
name: Publish package to PyPI
41+
needs: build
42+
runs-on: ubuntu-latest
43+
permissions:
44+
id-token: write
45+
contents: read
46+
environment:
47+
name: pypi
48+
url: https://pypi.org/p/musicalgestures
49+
steps:
50+
- name: Download distribution artifacts
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: dist
54+
path: dist/
55+
56+
- name: Publish to PyPI via trusted publishing
57+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)