forked from coqui-ai/Trainer
-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (53 loc) · 1.37 KB
/
pypi-release.yml
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
46
47
48
49
50
51
52
53
name: Publish Python 🐍 distributions 📦 to PyPI
on:
release:
types: [published]
defaults:
run:
shell:
bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify tag matches version
run: |
set -ex
version=$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o)
tag="${GITHUB_REF/refs\/tags\/}"
if [[ "v$version" != "$tag" ]]; then
exit 1
fi
- name: Setup uv
uses: ./.github/actions/setup-uv
- name: Set up Python
run: uv python install 3.12
- name: Build sdist and wheel
run: uv build
- name: Test installation of sdist and wheel
run: |
uv venv --no-project
uv pip install dist/*.tar.gz
uv pip install dist/*.whl
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/*
publish-artifacts:
runs-on: ubuntu-latest
needs: [build]
environment:
name: release
url: https://pypi.org/p/coqui-tts-trainer
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: "dist/"
name: build
- run: |
ls -lh dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1