Build and Publish GH+PyPi #103
This file contains hidden or 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 GH+PyPi | |
| on: | |
| workflow_dispatch: | |
| branches: | |
| - master | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" | |
| CIBW_ARCHS_LINUX: "x86_64" | |
| CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | |
| CIBW_ARCHS_WINDOWS: "AMD64" | |
| CIBW_MUSLLINUX_X86_64_IMAGE: "quay.io/pypa/musllinux_1_2_x86_64:2025.06.08-1" | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, windows-2025, macos-14] | |
| steps: | |
| - name: GitHub Checkout | |
| uses: actions/checkout@v4 | |
| - name: Upgrade pip | |
| run: python -m pip install --upgrade pip | |
| - name: Check ENV | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: echo $PATH | |
| - name: Setup Python 3.13+ for non-Windows | |
| if: matrix.os != 'windows-2025' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Build wheels Linux | |
| if: matrix.os == 'ubuntu-24.04' | |
| uses: pypa/[email protected] | |
| env: | |
| CIBW_BEFORE_ALL: "bash dev/tools/github/install_rust.sh" | |
| - name: Build wheels Mac | |
| if: matrix.os == 'macos-14' | |
| uses: pypa/[email protected] | |
| - name: Build wheels Windows | |
| if: matrix.os == 'windows-2025' | |
| uses: pypa/[email protected] | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| #overwrite: true | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: GitHub Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build sdist | |
| run: pipx run build --sdist | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: dist/*.tar.gz | |
| Release: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| contents: write | |
| discussions: write | |
| id-token: write | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Move all artifacts into dist_upload/ | |
| run: | | |
| rm -rf dist_upload | |
| mkdir -p dist_upload | |
| find dist -name '*.whl' -exec cp {} dist_upload/ \; | |
| find dist -name '*.tar.gz' -exec cp {} dist_upload/ \; | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: | | |
| Please read the [CHANGELOG](https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api/changelog.html) for further information. | |
| discussion_category_name: releases | |
| draft: false | |
| files: | | |
| dist_upload/*.tar.gz | |
| dist_upload/*.whl | |
| generate_release_notes: true | |
| name: unicorn-binance-websocket-api | |
| prerelease: false | |
| tag_name: 2.10.2 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create PyPi Release | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist_upload | |
| verbose: true | |
| print-hash: true |