Merge pull request #37 from omarmhaimdat/0.0.1-alpha.20 #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Package CI | |
# | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
clippy: | |
permissions: read-all | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
- uses: actions-rs/clippy@master | |
with: | |
args: --all-features --all-targets | |
cargo-publish: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
needs: clippy | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: katyo/publish-crates@v2 | |
with: | |
path: './quickner-core' | |
args: --no-verify | |
dry-run: false | |
ignore-unpublished-changes: true | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
linux: | |
name: Build wheels on Linux | |
runs-on: ubuntu-latest | |
needs: clippy | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: messense/maturin-action@v1 | |
with: | |
manylinux: auto | |
command: build | |
args: --release --sdist -o dist --find-interpreter | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
name: Build wheels on Windows | |
runs-on: windows-latest | |
needs: clippy | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --find-interpreter | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
name: Build wheels on macOS | |
runs-on: macos-latest | |
needs: clippy | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --universal2 --find-interpreter | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release to PyPi | |
runs-on: ubuntu-latest | |
needs: | |
- macos | |
- windows | |
- linux | |
if: ${{ github.ref == 'refs/heads/master' }} | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
- uses: actions/setup-python@v2 | |
- name: Publish to PyPi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
pip install --upgrade twine | |
twine upload --skip-existing * |