-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 960 Bytes
/
Copy pathrelease.yaml
File metadata and controls
39 lines (32 loc) · 960 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
name: Publish Python Package
on:
release:
types: [ created ]
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/complex-tokenization
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Extract release version
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Update version in pyproject.toml
run: |
sed -i 's/^version = .*/version = "${{ env.version }}"/' pyproject.toml
- name: Install build dependencies
run: pip install build
- name: Build a binary wheel dist
run: |
rm -rf dist
python -m build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1