Build and Publish GH+PyPi #4
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 GH+PyPi | |
on: | |
workflow_dispatch: | |
branches: | |
- master | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_SKIP: "pp36-* pp37-* pp38-*" | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-12] | |
steps: | |
- name: GitHub Checkout | |
uses: actions/checkout@v4 | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Set up Environment | |
run: echo "CIBW_SKIP=pp36-* pp37-* pp38-*" >> $GITHUB_ENV | |
- name: Check ENV | |
if: matrix.os == 'ubuntu-20.04' | |
run: echo $PATH | |
- name: Build wheels Linux | |
if: matrix.os == 'ubuntu-20.04' | |
uses: pypa/cibuildwheel@v2.16.5 | |
env: | |
CIBW_BEFORE_ALL: "bash dev/tools/github/install_rust.sh" | |
- name: Build wheels Mac | |
if: matrix.os == 'macos-12' | |
uses: pypa/cibuildwheel@v2.16.5 | |
- name: Build wheels Windows | |
if: matrix.os == 'windows-2019' | |
uses: pypa/cibuildwheel@v2.16.5 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
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@v3 | |
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@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: | | |
Please read the [CHANGELOG](https://unicorn-bybit-websocket-api.docs.lucit.tech/changelog.html) for further information. | |
discussion_category_name: releases | |
draft: false | |
files: | | |
dist/*.tar.gz | |
dist/*.whl | |
generate_release_notes: true | |
name: unicorn-bybit-websocket-api | |
prerelease: false | |
tag_name: 0.1.0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create PyPi Release | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
print-hash: true |