Skip to content

Commit 4465017

Browse files
committed
release workflow
1 parent 32ac2e0 commit 4465017

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to publish (e.g. 1.9.0)'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
pypi-publish:
13+
name: Build and publish to PyPI
14+
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write # IMPORTANT: mandatory for trusted publishing
17+
contents: read
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: v${{ github.event.inputs.version }}
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.x"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build twine
33+
34+
- name: Build package
35+
run: python -m build
36+
37+
- name: Publish package distributions to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)