mirror of
https://github.com/Tencent/ncnn.git
synced 2026-10-24 01:29:31 +08:00
cdb8ec218d
This reverts commit 882f114a8d.
94 lines
1.9 KiB
YAML
94 lines
1.9 KiB
YAML
name: release-python
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build_sdist:
|
|
name: Build SDist
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Install deps
|
|
run: python -m pip install twine build
|
|
|
|
- name: Build SDist
|
|
run: python -m build -s
|
|
|
|
- name: Check metadata
|
|
run: twine check dist/*
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
path: dist/*.tar.gz
|
|
|
|
|
|
build_wheels:
|
|
name: Wheels on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Install cibuildwheel
|
|
run: python -m pip install cibuildwheel
|
|
|
|
- name: Set up QEMU
|
|
if: runner.os == 'Linux'
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Build wheel
|
|
run: python -m cibuildwheel --output-dir wheelhouse
|
|
env:
|
|
CIBW_SKIP: "cp27-* pp27-*" # skip Python 2.7 wheels
|
|
# configure cibuildwheel to build native archs ('auto'), and some
|
|
# emulated ones
|
|
CIBW_ARCHS_LINUX: auto
|
|
|
|
- name: Show files
|
|
run: ls -lh wheelhouse
|
|
shell: bash
|
|
|
|
- name: Verify clean directory
|
|
run: git diff --exit-code
|
|
shell: bash
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: wheelhouse/*.whl
|
|
|
|
upload_all:
|
|
name: Upload
|
|
needs: [build_wheels, build_sdist]
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/setup-python@v2
|
|
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: artifact
|
|
path: dist
|
|
|
|
- uses: pypa/gh-action-pypi-publish@v1.4.1
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|