Skip to content

Upload Python Package #3

Upload Python Package

Upload Python Package #3

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
steps:
- uses: actions/checkout@v4
- name: Install prerequisites (Linux)
if: startsWith(runner.os, 'Linux')
run: |
sudo apt install libtbb-dev
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Compile on Windows
if: startsWith(runner.os, 'Windows')
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -A x64
cmake --build build --config Release
cd ..
- name: Compile on Linux / macOS
if: startsWith(runner.os, 'Linux')
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cd ..
- name: Archive binaries
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}
path: ecospy/binaries
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Download binaries
uses: actions/download-artifact@v4
with:
pattern: binaries-*
path: ecospy/binaries
merge-multiple: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PYTHONFMU_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*