123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- name: Build fate_crypto
- on:
- workflow_dispatch:
- inputs:
- source:
- description: "source branch"
- required: true
- type:
- description: "publish type, test or testpypi or pypi"
- required: false
- default: "test"
- jobs:
- macos:
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
- - name: Build Wheels - x86_64
- uses: messense/maturin-action@v1
- with:
- target: x86_64
- command: build
- args: --release -o dist -m rust/fate_crypto/Cargo.toml
- - name: Build wheels - universal2
- uses: messense/maturin-action@v1
- with:
- command: build
- args: --release --no-sdist -o dist --universal2 -m rust/fate_crypto/Cargo.toml
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- name: wheels
- path: dist
- windows:
- runs-on: windows-latest
- strategy:
- matrix:
- target: [x64, x86]
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
- - name: Build wheels
- uses: messense/maturin-action@v1
- with:
- command: build
- target: ${{ matrix.target }}
- args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- name: wheels
- path: dist
- linux:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- target: [x86_64, i686]
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - { uses: actions/setup-python@v2, with: { python-version: "3.6" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.7" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.8" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.9" } }
- - { uses: actions/setup-python@v2, with: { python-version: "3.10" } }
- - name: Build wheels
- uses: messense/maturin-action@v1
- with:
- command: build
- target: ${{ matrix.target }}
- manylinux: auto
- args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- name: wheels
- path: dist
- linux-cross:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- target: [aarch64, armv7, s390x, ppc64le]
- python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - name: Build Wheels
- uses: messense/maturin-action@v1
- with:
- target: ${{ matrix.target }}
- manylinux: auto
- command: build
- args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- name: wheels
- path: dist
- musllinux:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- target:
- - x86_64-unknown-linux-musl
- - i686-unknown-linux-musl
- python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - name: Build wheels
- uses: messense/maturin-action@v1
- with:
- target: ${{ matrix.target }}
- manylinux: musllinux_1_2
- args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- name: wheels
- path: dist
- musllinux-cross:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- platform:
- - target: aarch64-unknown-linux-musl
- arch: aarch64
- - target: armv7-unknown-linux-musleabihf
- arch: armv7
- python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- steps:
- - uses: actions/checkout@v2
- with:
- ref: ${{github.event.inputs.source}}
- - name: Build wheels
- uses: messense/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- manylinux: musllinux_1_2
- args: --release --no-sdist -o dist -m rust/fate_crypto/Cargo.toml -i ${{ matrix.python_version }}
- release:
- name: Release
- runs-on: ubuntu-latest
- needs: [macos, windows, linux, linux-cross, musllinux, musllinux-cross]
- steps:
- - uses: actions/download-artifact@v2
- with:
- name: wheels
- path: dist
- - uses: actions/setup-python@v2
- with:
- python-version: 3.6
- - name: Twine check
- run: |
- pip install -U twine
- twine check dist/*
- - name: Test Install
- run: |
- pip install -U pip
- pip install --find-link=dist/ fate_crypto
- - name: Upload to PyPI Test
- if: ${{ github.event.inputs.type == 'testpypi' }}
- run: |
- twine upload --repository testpypi dist/* --verbose
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.pypitest_token }}
- - name: Upload to PyPI
- if: ${{ github.event.inputs.type == 'pypi' }}
- run: |
- twine upload dist/* --verbose
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.pypi_token }}
|