|
| 1 | +# This file is autogenerated by maturin v1.7.4 and manually modified by ia0. |
| 2 | +name: Maturin |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - 'main' |
| 9 | + tags: |
| 10 | + - 'python-v*' |
| 11 | + schedule: |
| 12 | + - cron: '12 3 * * 4' # Refresh the cache weekly. |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + runs-on: ${{ matrix.platform.runner }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + platform: |
| 24 | + - runner: ubuntu-latest |
| 25 | + target: x86_64 |
| 26 | + - runner: windows-latest |
| 27 | + target: x64 |
| 28 | + - runner: macos-14 |
| 29 | + target: aarch64 |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + - if: matrix.platform.runner == 'ubuntu-latest' |
| 33 | + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 |
| 34 | + with: |
| 35 | + path: rust/onnx/runtime/build/Linux |
| 36 | + key: maturin-${{ matrix.platform.target }}-${{ hashFiles('rust/onnx/build.sh') }} |
| 37 | + - run: python3 ./python/scripts/fix_package_version.py |
| 38 | + - if: matrix.platform.runner == 'ubuntu-latest' |
| 39 | + name: Build wheels |
| 40 | + uses: PyO3/maturin-action@v1 |
| 41 | + with: |
| 42 | + target: ${{ matrix.platform.target }} |
| 43 | + args: --release --out=../dist |
| 44 | + before-script-linux: "${{ github.workspace }}/rust/onnx/maturin.sh" |
| 45 | + manylinux: 2_28 |
| 46 | + working-directory: python |
| 47 | + - if: matrix.platform.runner != 'ubuntu-latest' |
| 48 | + name: Build wheels |
| 49 | + uses: PyO3/maturin-action@v1 |
| 50 | + with: |
| 51 | + target: ${{ matrix.platform.target }} |
| 52 | + args: --release --out=../dist |
| 53 | + working-directory: python |
| 54 | + - name: Install wheels |
| 55 | + run: python3 -m pip install $(python -c "import glob; print(glob.glob('dist/*.whl')[0])") |
| 56 | + - run: magika --version |
| 57 | + - run: python3 -c 'import magika; print(magika.__version__)' |
| 58 | + - run: magika -r tests_data/basic |
| 59 | + - run: python3 ./python/scripts/run_quick_test_magika_cli.py |
| 60 | + - run: python3 ./python/scripts/run_quick_test_magika_module.py |
| 61 | + - name: Upload wheels |
| 62 | + if: github.event_name != 'pull_request' |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }} |
| 66 | + path: dist |
| 67 | + |
| 68 | + sdist: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + # TODO(https://github.com/PyO3/maturin/issues/2244): Remove when released. |
| 73 | + - run: rm rust/cli/README.md |
| 74 | + - run: python3 ./python/scripts/fix_package_version.py |
| 75 | + - name: Build sdist |
| 76 | + uses: PyO3/maturin-action@v1 |
| 77 | + with: |
| 78 | + command: sdist |
| 79 | + args: --out=../dist |
| 80 | + working-directory: python |
| 81 | + - name: Upload sdist |
| 82 | + if: github.event_name != 'pull_request' |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: wheels-sdist |
| 86 | + path: dist |
0 commit comments