Build Wheels #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install wheel | |
- 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: Upload Graph | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-graph-v${{ github.event.inputs.version}} | |
path: graph | |
- name: Publish on pypi.org | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
python setup.py sdist bdist_wheel --version=${{ github.event.inputs.version}} | |
python -m pip install -U twine | |
python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/* |