v3.0.0-beta.6 #12
Workflow file for this run
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: PyPI Publish | |
on: | |
# push: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-11] | |
# os: [ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup node and npm | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.4 | |
- name: Build the tree-sitter parser | |
run: | | |
cd tree-sitter-usfm3 | |
npm install . | |
./node_modules/.bin/tree-sitter generate | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.9.0 | |
env: | |
CIBW_BEFORE_BUILD: > | |
python -m pip install tree-sitter==0.20.0 && | |
python py-usfm-parser/src/grammar_rebuild.py tree-sitter-usfm3 py-usfm-parser/src/usfm_grammar/my-languages.so | |
with: | |
package-dir: py-usfm-parser | |
output-dir: py-usfm-parser/dist | |
config-file: "py-usfm-parser/pyproject.toml" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: py-usfm-parser/dist/*.whl | |
publish_to_pypi: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: py-usfm-parser/dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
# repository_url: https://test.pypi.org/legacy/ | |
packages_dir: py-usfm-parser/dist/ |