-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.84 KB
/
release.yml
File metadata and controls
71 lines (61 loc) · 1.84 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
66
67
68
69
70
71
name: Release
on:
push:
tags:
# Publish on any tag starting with a `v`, e.g. v0.1.0
- v*
workflow_dispatch:
jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Build
run: uv build --no-sources
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl python -c "import hyper_models; print(hyper_models.__version__)"
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz python -c "import hyper_models; print(hyper_models.__version__)"
- name: Upload dist artifacts
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
pypi:
name: Publish to PyPI
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
# Create this environment in the GitHub repository under Settings -> Environments
name: pypi
url: https://pypi.org/p/hyper-models
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: read
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/