-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.18 KB
/
Copy pathrelease.yml
File metadata and controls
44 lines (35 loc) · 1.18 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
name: Publish to PyPI
on:
push:
tags:
- "v*.*.*" # trigger on version tags: v1.0.0, v1.2.3, …
jobs:
pypi-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # Mandatory for PyPI trusted publishing
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install build tools
run: python3 -m pip install --upgrade pip hatchling twine build
- name: Build source and wheel dist
# Uses hatchling as defined in pyproject.toml
run: |
echo "==> Set prod logging"
mv batch_img/config.json batch_img/config_bk.json
cp -p batch_img/config_prod.json batch_img/config.json
echo "Build by hatchling defined in pyproject.toml"
python3 -m build
echo "==> Restore config.json"
mv batch_img/config_bk.json batch_img/config.json
- name: Validate dist files
run: twine check dist/*
- name: Publish dist to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/