Use ubuntu instead of centos in the pypi workflow #168
Workflow file for this run
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/upload sdist and wheel Package to PyPI | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
paths-ignore: | |
- 'example/**' | |
- 'docs/**' | |
- 'data/**' | |
pull_request: | |
branches: | |
- master | |
- develop | |
paths-ignore: | |
- 'example/**' | |
- 'docs/**' | |
- 'data/**' | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build sdist and wheel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Add tag to version.py file | |
run: | | |
git describe --abbrev=7 --dirty --always --tags | \ | |
sed 's/dirty/mod/g' | \ | |
sed 's/-/+/' | \ | |
sed 's/-/./g' | \ | |
sed 's/v//' > ./build/python/vina/version.py | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y swig libboost-all-dev | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel build | |
- name: Build sdist and wheel | |
run: | | |
cp -R ./build/python/* . | |
cp ./build/python/setup.py . | |
cp ./build/python/MANIFEST.in . | |
python -m build | |
- name: Upload Built Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/* | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel packaging | |
- name: Install boost-devel and swig | |
run: | | |
sudo apt-get install -y libboost-all-dev swig | |
- name: Build sdist | |
run: | | |
cd ./build/python | |
python setup.py sdist | |
- name: Upload artifacts for inspection | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: ./build/python/dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools twine | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: ./dist | |
- name: Publish sdist and wheel to PyPI | |
run: | | |
twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_FORLILAB }} |