forked from linkml/linkml
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.66 KB
/
pypi-publish.yaml
File metadata and controls
61 lines (54 loc) · 1.66 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish Python Package
# Upload to PyPI is triggered by creating & publishing a release in GitHub UI
env:
UV_VERSION: "0.7.13"
on:
release:
# Trigger the workflow only for real releases but not for draft releases
types: [created]
jobs:
build:
name: Build Python 🐍 distributions 📦 for publishing to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# Checkout the code including tags required for dynamic versioning
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6.2.0
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v7.3.1
with:
version: ${{ env.UV_VERSION }}
- name: Build source and wheel archives
run: |
uv build --all-packages
- name: Store built distribution
uses: actions/upload-artifact@v7.0.0
with:
name: distribution-files
path: dist/
pypi-publish:
name: Build and publish Python 🐍 package 📦 to PyPI
needs: build
runs-on: ubuntu-latest
# Uses trusted publishing. https://docs.pypi.org/trusted-publishers/adding-a-publisher/
environment:
name: pypi-release
url: https://pypi.org/p/linkml
permissions:
id-token: write # This permission is mandatory for trusted publishing.
steps:
- name: Download built distribution
uses: actions/download-artifact@v8.0.0
with:
name: distribution-files
path: dist
- name: Publish package 📦 to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
verbose: true