-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (27 loc) · 888 Bytes
/
Copy pathpublish.yml
File metadata and controls
34 lines (27 loc) · 888 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
name: Publish
on:
release:
types: [published]
jobs:
pypi:
runs-on: ubuntu-22.04
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install twine jinja2
- id: pkg_version
run: echo "data=$(echo ${{ github.event.release.tag_name }} | cut -c2-)" >> $GITHUB_OUTPUT
- name: Build Python package
run: |
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1