CI #138
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 0/2' | |
| jobs: | |
| linux: | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| spec: ['cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312'] | |
| image: [manylinux2014_x86_64, manylinux_2_28_x86_64, manylinux_2_34_x86_64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build packages | |
| env: | |
| IVPM_PYTHON: /opt/python/${{ matrix.spec }}/bin/python | |
| BUILD_NUM: ${{ github.run_id }} | |
| run: > | |
| docker run --rm | |
| --volume "$(pwd):/io" | |
| --env IVPM_PYTHON | |
| --env BUILD_NUM | |
| --workdir /io | |
| quay.io/pypa/${{ matrix.image }} | |
| /io/scripts/build_linux.sh | |
| - name: Publish to PyPi | |
| if: startsWith(github.ref, 'refs/heads/main') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python3 -m pip install -U twine packaging | |
| python3 -m twine upload wheelhouse/*.whl | |
| macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - pyversion: '3.8' | |
| - pyversion: '3.9' | |
| - pyversion: '3.10' | |
| - pyversion: '3.11' | |
| - pyversion: '3.12' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Fetch dependencies | |
| run: | | |
| python3 --version | |
| python3 -m venv py | |
| ./py/bin/python3 -m pip install ivpm | |
| ./py/bin/python3 -m ivpm update -a | |
| ./packages/python/bin/python3 -m pip install cython setuptools wheel build twine | |
| - name: Build wheel | |
| env: | |
| BUILD_NUM: ${{ github.run_id }} | |
| run: | | |
| echo "BUILD_NUM=${BUILD_NUM}" > python/debug_mgr/__build_num__.py | |
| ./packages/python/bin/python3 setup.py bdist_wheel | |
| - name: Publish to PyPi | |
| if: startsWith(github.ref, 'refs/heads/main') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| ./packages/python/bin/python3 -m twine upload dist/*.whl | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - pyversion: '3.8' | |
| - pyversion: '3.9' | |
| - pyversion: '3.10' | |
| - pyversion: '3.11' | |
| - pyversion: '3.12' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: Install python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - uses: ilammy/[email protected] | |
| with: | |
| arch: x64 | |
| - name: Build/Test Package | |
| env: | |
| BUILD_NUM: ${{ github.run_id }} | |
| run: | | |
| python -m pip install ivpm | |
| python -m ivpm update -a | |
| ./packages/python/Scripts/python -m pip install ninja cython setuptools wheel build twine | |
| echo "BUILD_NUM=$env:BUILD_NUM" > python/debug_mgr/__build_num__.py | |
| ./packages/python/Scripts/python setup.py build bdist_wheel | |
| - name: Publish to PyPi | |
| if: startsWith(github.ref, 'refs/heads/main') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| shell: bash | |
| run: | | |
| ./packages/python/Scripts/python -m twine upload dist/*.whl |