Skip to content

Build and Publish

Build and Publish #48

Workflow file for this run

name: Build and Publish
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'ms_entropy/version.py'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_SKIP: pp*
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
overwrite: true
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Build
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install setuptools
python setup.py sdist
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
overwrite: true
upload_pypi:
name: Upload to PyPI
needs: [build_wheels, build]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}