Version 1.0.0a1 #48
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: Python package build, publish, and github release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout with submodules | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry twine | |
- name: Copy schema files from upstream | |
run: ./copy-schema-files.sh | |
- name: Build manylinux Python 3.9 wheels | |
uses: RalfG/[email protected] | |
with: | |
pre-build-command: 'sh pre-build.sh' | |
python-versions: 'cp39-cp39' | |
build-requirements: 'capnpy jinja2 poetry-core setuptools' | |
pip-wheel-args: '-w ./dist --no-deps --no-build-isolation' | |
system-packages: 'capnproto' | |
- name: Remove obsolete wheels | |
run: sudo rm dist/*manylinux_2_17_x86_64.whl | |
- name: Build manylinux Python 3.10 wheels | |
uses: RalfG/[email protected] | |
with: | |
pre-build-command: 'sh pre-build.sh' | |
python-versions: 'cp310-cp310' | |
build-requirements: 'capnpy jinja2 poetry-core setuptools' | |
pip-wheel-args: '-w ./dist --no-deps --no-build-isolation' | |
system-packages: 'capnproto' | |
- name: Remove obsolete wheels | |
run: sudo rm dist/*manylinux_2_17_x86_64.whl | |
- name: Build manylinux Python 3.11 wheels | |
uses: RalfG/[email protected] | |
with: | |
pre-build-command: 'sh pre-build.sh' | |
python-versions: 'cp311-cp311' | |
build-requirements: 'capnpy jinja2 poetry-core setuptools' | |
pip-wheel-args: '-w ./dist --no-deps --no-build-isolation' | |
system-packages: 'capnproto' | |
- name: Remove obsolete wheels | |
run: sudo rm dist/*manylinux_2_17_x86_64.whl | |
- name: Build python files #(Yes this is redundant but poetry wont include python files in wheels that don't exist when it starts) | |
uses: RalfG/[email protected] | |
with: | |
pre-build-command: 'sh pre-build.sh' | |
python-versions: 'pp39-pypy39_pp73' | |
build-requirements: 'capnpy jinja2 poetry-core setuptools' | |
pip-wheel-args: '-w ./dist --no-deps --no-build-isolation' | |
system-packages: 'capnproto' | |
- name: Remove empty pypy wheel | |
run: sudo rm dist/*pp39-pypy39_pp73*.whl | |
- name: Build manylinux Python3 pypy wheels | |
uses: RalfG/[email protected] | |
with: | |
pre-build-command: 'sh pre-build.sh' | |
python-versions: 'pp39-pypy39_pp73' | |
build-requirements: 'capnpy jinja2 poetry-core setuptools' | |
pip-wheel-args: '-w ./dist --no-deps --no-build-isolation' | |
system-packages: 'capnproto' | |
- name: Fix dist permissions | |
run: sudo chmod -R 777 dist | |
- name: Rename pypy package build | |
run: | | |
old=$(ls -1 dist/*pp39-pypy39_pp73*.whl) | |
new=$(echo $old | sed -e 's/pp39-pypy39_pp73-manylinux_2_17_x86_64/py3-none-any/') | |
sudo mv -v "$old" "$new" | |
- name: Build sdist | |
run: poetry build --format sdist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dist/*.whl | |
dist/*.tar.gz | |
- name: Publish wheels to PyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
twine upload dist/*.whl | |
twine upload dist/*.tar.gz |