-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (62 loc) · 1.93 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (62 loc) · 1.93 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
name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
- run: python -m pip install -e ".[dev]"
- name: Verify tag version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PY'
import os, tomllib
expected = os.environ["RELEASE_TAG"].removeprefix("v")
with open("pyproject.toml", "rb") as stream:
actual = tomllib.load(stream)["project"]["version"]
if actual != expected:
raise SystemExit(f"release tag {expected!r} does not match package {actual!r}")
PY
- run: python -m pytest src/tests/unit
- run: ruff check src scripts
- run: pyright
- run: mkdocs build --strict
- run: python -m build --wheel
- run: python -m twine check dist/*.whl
- run: python scripts/check_wheel_contents.py dist/*.whl
- name: Test the release wheel
run: |
WHEEL=$(find dist -name '*.whl' -print -quit)
python -m venv .wheel-test
.wheel-test/bin/python -m pip install "${WHEEL}[dev]"
.wheel-test/bin/python -m pytest src/tests/unit
- uses: actions/upload-artifact@v4
with:
name: release-distributions
path: dist/*.whl
if-no-files-found: error
publish:
needs: build-and-test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/iris-pex-embedded-python
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: release-distributions
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1