-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1016 Bytes
/
release.yml
File metadata and controls
45 lines (35 loc) · 1016 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
37
38
39
40
41
42
43
44
45
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write # for creating GitHub Release
id-token: write # for PyPI trusted publishing (OIDC)
jobs:
release:
runs-on: ubuntu-latest
environment: pypi # matches the trusted publisher environment on PyPI
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install hatch
run: pip install hatch
- name: Run tests before releasing
run: |
pip install -e ".[dev]"
pytest --tb=short -q
- name: Build distributions
run: hatch build
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
# No api_token needed — uses OIDC trusted publishing