Skip to content

Updated to libcosimc/0.11.0@osp/stable #172

Updated to libcosimc/0.11.0@osp/stable

Updated to libcosimc/0.11.0@osp/stable #172

Workflow file for this run

name: libcosimpy CI
# This workflow is triggered on pushes to the repository.
on: [push, workflow_dispatch]
jobs:
code_quality:
name: Code Quality
runs-on: 'ubuntu-latest'
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --no-install-project
- name: Run ruff format
run: uv run --no-project ruff format --diff
- name: Run ruff check
run: uv run --no-project ruff check --diff
- name: Run pyright
run: uv run --no-project pyright
build_wheels_and_test:
name: Build / Test
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ 'windows-latest', 'ubuntu-latest' ]
python-version: [ 'cp310', 'cp311', 'cp312', 'cp313' ]
timeout-minutes: 35
env:
CONAN_REVISIONS_ENABLED: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Build wheels
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_BUILD: "${{ matrix.python-version }}-win_amd64 ${{ matrix.python-version }}-manylinux_x86_64"
CIBW_BUILD_FRONTEND: build[uv]
CIBW_ENVIRONMENT: >
CONAN_UPLOAD_OSP=1
CONAN_LOGIN_USERNAME_OSP=${{ secrets.osp_artifactory_usr }}
CONAN_PASSWORD_OSP=${{ secrets.osp_artifactory_pwd }}
- name: Twine check
run: |
pip install twine
twine check --strict ./wheelhouse/*
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
name: Upload artifact (wheels)
with:
name: libcosimpy-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.python-version }}-wheel
path: ./wheelhouse/*.whl
build_source:
name: Package source
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build source
run: |
pip install build twine
python -m build --sdist
twine check --strict ./dist/*
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
name: Upload artifact (source)
with:
name: libcosimpy-${{ github.ref_name }}-source
path: ./dist/*.tar.gz
publish:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs:
- code_quality
- build_wheels_and_test
- build_source
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: "*-wheel"
merge-multiple: true
path: ./dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}