Refactor #156
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 | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-12] | |
steps: | |
- uses: actions/checkout@v3 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v3 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.16.2 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_ALL: > | |
curl -O https://capnproto.org/capnproto-c++-0.10.4.tar.gz && | |
tar zxf capnproto-c++-0.10.4.tar.gz && | |
cd capnproto-c++-0.10.4 && | |
./configure && | |
make -j6 check && | |
make install | |
CIBW_TEST_COMMAND: pytact-check --help | |
CIBW_SKIP: "pp*" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install capnp | |
run: sudo apt-get install capnproto libcapnp-dev | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/pytactician-v') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
# unpacks default artifact into dist/ | |
# if `name: artifact` is omitted, the action will create extra parent dir | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD_RELEASE }} | |
# password: ${{ secrets.PYPI_PASSWORD }} | |
# repository_url: https://test.pypi.org/legacy/ |