build_fate_crypto.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. name: Build fate_crypto
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. source:
  6. description: "source branch"
  7. required: true
  8. type:
  9. description: "publish type, test or testpypi or pypi"
  10. required: false
  11. default: "test"
  12. jobs:
  13. macos:
  14. runs-on: macos-latest
  15. steps:
  16. - uses: actions/checkout@v2
  17. with:
  18. ref: ${{github.event.inputs.source}}
  19. - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
  20. - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
  21. - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
  22. - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
  23. - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
  24. - name: Build Wheels - x86_64
  25. uses: messense/maturin-action@v1
  26. with:
  27. target: x86_64
  28. command: build
  29. args: --release -o dist -m rust/fate_crypto/Cargo.toml
  30. - name: Build wheels - universal2
  31. uses: messense/maturin-action@v1
  32. with:
  33. command: build
  34. args: --release --no-sdist -o dist --universal2 -m rust/fate_crypto/Cargo.toml
  35. - name: Upload wheels
  36. uses: actions/upload-artifact@v2
  37. with:
  38. name: wheels
  39. path: dist
  40. windows:
  41. runs-on: windows-latest
  42. strategy:
  43. matrix:
  44. target: [x64, x86]
  45. steps:
  46. - uses: actions/checkout@v2
  47. with:
  48. ref: ${{github.event.inputs.source}}
  49. - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
  50. - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
  51. - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
  52. - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
  53. - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
  54. - name: Build wheels
  55. uses: messense/maturin-action@v1
  56. with:
  57. command: build
  58. target: ${{ matrix.target }}
  59. args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml
  60. - name: Upload wheels
  61. uses: actions/upload-artifact@v2
  62. with:
  63. name: wheels
  64. path: dist
  65. linux:
  66. runs-on: ubuntu-latest
  67. strategy:
  68. matrix:
  69. target: [x86_64, i686]
  70. steps:
  71. - uses: actions/checkout@v2
  72. with:
  73. ref: ${{github.event.inputs.source}}
  74. - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
  75. - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
  76. - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
  77. - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
  78. - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
  79. - name: Build wheels
  80. uses: messense/maturin-action@v1
  81. with:
  82. command: build
  83. target: ${{ matrix.target }}
  84. manylinux: auto
  85. args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml
  86. - name: Upload wheels
  87. uses: actions/upload-artifact@v2
  88. with:
  89. name: wheels
  90. path: dist
  91. linux-cross:
  92. runs-on: ubuntu-latest
  93. strategy:
  94. fail-fast: false
  95. matrix:
  96. target: [aarch64, armv7, s390x, ppc64le]
  97. python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
  98. steps:
  99. - uses: actions/checkout@v2
  100. with:
  101. ref: ${{github.event.inputs.source}}
  102. - name: Build Wheels
  103. uses: messense/maturin-action@v1
  104. with:
  105. target: ${{ matrix.target }}
  106. manylinux: auto
  107. command: build
  108. args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
  109. - name: Upload wheels
  110. uses: actions/upload-artifact@v2
  111. with:
  112. name: wheels
  113. path: dist
  114. musllinux:
  115. runs-on: ubuntu-latest
  116. strategy:
  117. fail-fast: false
  118. matrix:
  119. target:
  120. - x86_64-unknown-linux-musl
  121. - i686-unknown-linux-musl
  122. python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
  123. steps:
  124. - uses: actions/checkout@v2
  125. with:
  126. ref: ${{github.event.inputs.source}}
  127. - name: Build wheels
  128. uses: messense/maturin-action@v1
  129. with:
  130. target: ${{ matrix.target }}
  131. manylinux: musllinux_1_2
  132. args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
  133. - name: Upload wheels
  134. uses: actions/upload-artifact@v2
  135. with:
  136. name: wheels
  137. path: dist
  138. musllinux-cross:
  139. runs-on: ubuntu-latest
  140. strategy:
  141. fail-fast: false
  142. matrix:
  143. platform:
  144. - target: aarch64-unknown-linux-musl
  145. arch: aarch64
  146. - target: armv7-unknown-linux-musleabihf
  147. arch: armv7
  148. python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
  149. steps:
  150. - uses: actions/checkout@v2
  151. with:
  152. ref: ${{github.event.inputs.source}}
  153. - name: Build wheels
  154. uses: messense/maturin-action@v1
  155. with:
  156. target: ${{ matrix.platform.target }}
  157. manylinux: musllinux_1_2
  158. args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
  159. release:
  160. name: Release
  161. runs-on: ubuntu-latest
  162. needs: [macos, windows, linux, linux-cross, musllinux, musllinux-cross]
  163. steps:
  164. - uses: actions/download-artifact@v2
  165. with:
  166. name: wheels
  167. path: dist
  168. - uses: actions/setup-python@v2
  169. with:
  170. python-version: 3.6
  171. - name: Twine check
  172. run: |
  173. pip install -U twine
  174. twine check dist/*
  175. - name: Test Install
  176. run: |
  177. pip install -U pip
  178. pip install --find-link=dist/ fate_crypto
  179. - name: Upload to PyPI Test
  180. if: ${{ github.event.inputs.type == 'testpypi' }}
  181. run: |
  182. twine upload --repository testpypi dist/* --verbose
  183. env:
  184. TWINE_USERNAME: __token__
  185. TWINE_PASSWORD: ${{ secrets.pypitest_token }}
  186. - name: Upload to PyPI
  187. if: ${{ github.event.inputs.type == 'pypi' }}
  188. run: |
  189. twine upload dist/* --verbose
  190. env:
  191. TWINE_USERNAME: __token__
  192. TWINE_PASSWORD: ${{ secrets.pypi_token }}