Fixed upload dist #124
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: Build And Publish | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- '.github/workflows/*' | |
- 'cmake/*' | |
- 'deps/*' | |
- 'include/*' | |
- 'ntgcalls/*' | |
- 'wrtc/*' | |
- 'CMakeLists.txt' | |
- 'setup.py' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
cibw_archs: "native" | |
shared_name: "linux-x86_64" | |
cibw_os_build: "manylinux_" | |
#- os: ubuntu-latest | |
# cibw_archs: "aarch64" | |
# shared_name: "linux-arm64" | |
# cibw_os_build: "manylinux_" | |
- os: windows-latest | |
cibw_archs: "native" | |
shared_name: "windows-x86_64" | |
- os: macos-13 | |
cibw_archs: "arm64" | |
cibw_os_build: "macosx_arm64" | |
shared_name: "macos-arm64" | |
fail-fast: false | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
if: matrix.cibw_archs == 'aarch64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Build Shared Libs | |
run: python3 setup.py build_shared --no-preserve-cache | |
- name: Upload shared libs for ${{ matrix.shared_name }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ntgcalls-${{ matrix.shared_name }}-lib.zip | |
path: ./shared-output/* | |
if-no-files-found: error | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" | |
CIBW_BUILD: cp3*-${{ matrix.cibw_os_build }}* | |
CIBW_SKIP: cp36-* | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_TEST_SKIP: "*-macosx_arm64" | |
CIBW_TEST_COMMAND: python -c "from ntgcalls import NTgCalls; NTgCalls().ping()" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ntgcalls-${{ matrix.shared_name }}-wheels.zip | |
path: ./wheelhouse/*.whl | |
if-no-files-found: error | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: tmp/ | |
- name: Extract artifacts | |
run: | | |
mkdir dist | |
find tmp -type f -name "*.whl" | xargs -I {} mv {} dist | |
- name: Publish a Python distribution to PyPI. | |
if: github.ref == 'refs/heads/master' && github.repository == 'pytgcalls/ntgcalls' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
packages-dir: dist/ |