Build and Publish GH+PyPi #42
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: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
discussions: write | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_ENVIRONMENT: "PATH=/home/runner/.cargo/bin:${PATH}" | |
# CIBW_BEFORE_BUILD: "pip uninstall -y cryptography pyOpenSSL service-identity" | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-11] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Add rust to ENV | |
if: matrix.os == 'ubuntu-20.04' | |
run: echo "PATH=$PATH:/home/runner/.cargo/bin" >> $GITHUB_ENV | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Set up Environment | |
run: echo "CIBW_SKIP=pp36-* pp37-* pp38-* pp39-* pp310-*" >> $GITHUB_ENV | |
- name: Set up CIBuildWheel Environment | |
run: echo "CIBW_ENVIRONMENT=PATH=/home/runner/.cargo/bin:${PATH}" >> $GITHUB_ENV | |
- name: Debug Rust | |
run: | | |
which rustc | |
rustc --version | |
- name: Ensure pip is installed | |
run: | | |
sudo apt install python3-pip | |
python -m pip --version | |
- name: Install cryptography | |
run: python -m pip install cryptography | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
Release: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
Please read the [CHANGELOG](https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/blob/main/CHANGELOG.md) for further information. | |
discussion_category_name: releases | |
draft: false | |
files: | | |
dist/*.tar.gz | |
dist/*.whl | |
generate_release_notes: true | |
name: unicorn-binance-websocket-api | |
prerelease: false | |
tag_name: 1.46.3 | |
token: ${{ secrets.RELEASE_TOKEN }} |