-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (36 loc) · 987 Bytes
/
python-publish.yml
File metadata and controls
38 lines (36 loc) · 987 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
name: publish to pypi
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch full history for proper version detection
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install hatch
- name: Build artifacts
run: hatch build
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
password: ${{ secrets.PYPI_TOKEN }}
print-hash: true
skip-existing: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}