-
Notifications
You must be signed in to change notification settings - Fork 173
65 lines (54 loc) · 1.57 KB
/
Copy pathbuild-publish.yml
File metadata and controls
65 lines (54 loc) · 1.57 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
62
63
64
65
name: Build and publish pyModeS
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build pure-Python wheel and sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build
run: uv build
- name: Smoke-test the built wheel
# Installs the wheel into a fresh venv and verifies the
# public API works end to end. Fails the build if the
# wheel is structurally broken or the API regressed.
run: scripts/smoke_test.sh
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
publish:
needs: [build]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
# OIDC trusted publishing: PyPI verifies the GitHub run
# identity via short-lived tokens, so no secret is needed.
# Configured at https://pypi.org/manage/project/pyModeS/
# settings/publishing/ against the `pypi` GitHub environment.
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*