Skip to content

Commit

Permalink
chore: enhance fate_crypto build
Browse files Browse the repository at this point in the history
Signed-off-by: weiwee <[email protected]>
  • Loading branch information
sagewe committed Aug 16, 2022
1 parent 199ddbd commit e5f4d67
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 99 deletions.
194 changes: 194 additions & 0 deletions .github/workflows/build_fate_crypto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
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 }}
99 changes: 0 additions & 99 deletions .github/workflows/build_wheel.yml

This file was deleted.

0 comments on commit e5f4d67

Please sign in to comment.