Add support for Linux ARM for Python wheels (#370) #278
Workflow file for this run
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: Python Wheels | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 10.9 | |
| DOCKER_IMAGE: quay.io/pypa/manylinux2014_x86_64 | |
| DOCKER_IMAGE_AARCH64: quay.io/pypa/manylinux_2_28_aarch64 | |
| # Unable to build numpy using the earlier image below | |
| #quay.io/pypa/manylinux2014_aarch64 | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| tags: [ "*" ] | |
| pull_request: | |
| branches: [ "*" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, windows-latest, macOS-latest] | |
| pyver: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v4 | |
| if: ${{ !startsWith(matrix.os, 'ubuntu') }} | |
| with: | |
| python-version: ${{matrix.pyver}} | |
| id: cpver | |
| - name: Setup Git name | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "<>" | |
| git --version | |
| - name: Package Python 3.8-3.x Linux x86_64 | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: docker run --rm -v ${{github.workspace}}/:/io $DOCKER_IMAGE sh /io/tools/package.sh /io /io/dist travis OFF Release ${{ matrix.pyver }} | |
| - name: Install QEMU | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: | | |
| docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
| - name: Package Python 3.9-3.x Linux Arm64 | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: docker run --rm -v ${{github.workspace}}/:/io $DOCKER_IMAGE_AARCH64 sh /io/tools/package.sh /io /io/dist travis OFF Release ${{ matrix.pyver }} | |
| - name: Windows Package Python | |
| if: ${{ startsWith(matrix.os, 'windows') }} | |
| shell: cmd | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel numpy | |
| tools\package.bat Release "Visual Studio 17 2022" package_wheel "-DENABLE_APPS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_CSHARP=OFF -DPython_EXECUTABLE=${{ steps.cpver.outputs.python-path }} -DENABLE_PORTABLE=ON" | |
| - name: Mac OSX Package Python | |
| if: ${{ startsWith(matrix.os, 'macOS') }} | |
| run: bash ./tools/package.sh ${{github.workspace}} ${{github.workspace}}/dist travis OFF Release ${{matrix.pyver}} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact_${{matrix.pyver}}_${{matrix.os}} | |
| path: dist/*.whl | |
| publishtest: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags') != true | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Print dist | |
| run: ls -lR dist | |
| - name: Test Publish a Python distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| packages_dir: ./dist | |
| repository_url: https://test.pypi.org/legacy/ | |
| skip_existing: true | |
| verbose: true | |
| publish: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish a Python distribution to PyPI | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| packages_dir: ./dist | |
| skip_existing: true | |
| #-name: Deploy documentation to GitHub Pages | |
| # uses: JamesIves/github-pages-deploy-action@v4.3.3 | |
| # with: | |
| # branch: gh-pages | |
| # folder: site | |
| # ssh-key: ${{ secrets.DEPLOY_KEY }} |