-
Notifications
You must be signed in to change notification settings - Fork 101
71 lines (63 loc) · 2.1 KB
/
wheels.yml
File metadata and controls
71 lines (63 loc) · 2.1 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build Wheels
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (optional, will be determined by setuptools_scm if not provided)'
required: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install build twine
- name: Build Graph
run: |
python -m tn --text "2.5平方电线" --overwrite_cache --language "zh"
python -m tn --text "2010-03-21" --overwrite_cache --language "en"
python -m itn --text "二点五平方电线" --overwrite_cache
- name: Prepare Graph
run: |
mkdir graph
cp tn/*.fst graph
cp itn/*.fst graph
- name: Get version from setuptools_scm
id: scm_version
run: |
# Check if version is provided as input
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
# Get version from setuptools_scm
pip install setuptools_scm
VERSION=$(python -m setuptools_scm | tail -1)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
fi
- name: Upload Graph
uses: actions/upload-artifact@v4
with:
name: release-graph-v${{ steps.scm_version.outputs.VERSION }}
path: graph
- name: Build package
run: |
python -m build
- name: Publish on pypi.org
if: github.ref == 'refs/heads/master' && github.repository == 'wenet-e2e/WeTextProcessing'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*