CI.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # This file is autogenerated by maturin v1.0.0
  2. # To update, run
  3. #
  4. # maturin generate-ci github
  5. #
  6. name: CI
  7. on:
  8. push:
  9. branches:
  10. - main
  11. - master
  12. tags:
  13. - '*'
  14. pull_request:
  15. workflow_dispatch:
  16. permissions:
  17. contents: read
  18. jobs:
  19. linux:
  20. runs-on: ubuntu-latest
  21. strategy:
  22. matrix:
  23. target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
  24. steps:
  25. - uses: actions/checkout@v3
  26. - uses: actions/setup-python@v4
  27. with:
  28. python-version: '3.10'
  29. - name: Build wheels
  30. uses: PyO3/maturin-action@v1
  31. with:
  32. target: ${{ matrix.target }}
  33. args: --release --out dist --find-interpreter
  34. sccache: 'true'
  35. manylinux: auto
  36. - name: Upload wheels
  37. uses: actions/upload-artifact@v3
  38. with:
  39. name: wheels
  40. path: dist
  41. windows:
  42. runs-on: windows-latest
  43. strategy:
  44. matrix:
  45. target: [x64, x86]
  46. steps:
  47. - uses: actions/checkout@v3
  48. - uses: actions/setup-python@v4
  49. with:
  50. python-version: '3.10'
  51. architecture: ${{ matrix.target }}
  52. - name: Build wheels
  53. uses: PyO3/maturin-action@v1
  54. with:
  55. target: ${{ matrix.target }}
  56. args: --release --out dist --find-interpreter
  57. sccache: 'true'
  58. - name: Upload wheels
  59. uses: actions/upload-artifact@v3
  60. with:
  61. name: wheels
  62. path: dist
  63. macos:
  64. runs-on: macos-latest
  65. strategy:
  66. matrix:
  67. target: [x86_64, aarch64]
  68. steps:
  69. - uses: actions/checkout@v3
  70. - uses: actions/setup-python@v4
  71. with:
  72. python-version: '3.10'
  73. - name: Build wheels
  74. uses: PyO3/maturin-action@v1
  75. with:
  76. target: ${{ matrix.target }}
  77. args: --release --out dist --find-interpreter
  78. sccache: 'true'
  79. - name: Upload wheels
  80. uses: actions/upload-artifact@v3
  81. with:
  82. name: wheels
  83. path: dist
  84. sdist:
  85. runs-on: ubuntu-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: Build sdist
  89. uses: PyO3/maturin-action@v1
  90. with:
  91. command: sdist
  92. args: --out dist
  93. - name: Upload sdist
  94. uses: actions/upload-artifact@v3
  95. with:
  96. name: wheels
  97. path: dist
  98. release:
  99. name: Release
  100. runs-on: ubuntu-latest
  101. if: "startsWith(github.ref, 'refs/tags/')"
  102. needs: [linux, windows, macos, sdist]
  103. steps:
  104. - uses: actions/download-artifact@v3
  105. with:
  106. name: wheels
  107. - name: Publish to PyPI
  108. uses: PyO3/maturin-action@v1
  109. env:
  110. MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
  111. with:
  112. command: upload
  113. args: --skip-existing *