-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (28 loc) · 913 Bytes
/
Copy pathrelease.yml
File metadata and controls
36 lines (28 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Publish Python Package to PyPI
on:
push:
tags:
- 'v*.*.*' # Trigger on version tags like v1.0.0
workflow_dispatch: # Allow manual trigger
jobs:
build-and-publish:
runs-on: ubuntu-latest
# Enable OIDC token permissions for Trusted Publisher
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install build tools
run: pip install build
- name: Build the package
run: python -m build
- name: Publish package distributions to PyPI using Trusted Publisher
# This action uses OIDC to authenticate without API tokens
uses: pypa/gh-action-pypi-publish@release/v1