Skip to content

Commit

Permalink
Using cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Jul 12, 2024
1 parent 5c02d3c commit 1f43ece
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 357 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build and publish libcosimc
uses: pypa/[email protected]
env:
CIBW_ENVIRONMENT: >
CONAN_LOGIN_USERNAME_OSP=${{ secrets.osp_artifactory_usr }}
CONAN_PASSWORD_OSP=${{ secrets.osp_artifactory_pwd }}
CONAN_NON_INTERACTIVE=1
CONAN_REVISIONS_ENABLED=1
CONAN_USE_ALWAYS_SHORT_PATHS=1
CIBW_BEFORE_BUILD: |
pip install conan==1.64.0
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
conan install proxyfmu/0.3.1@osp/stable -b missing
conan install libcosimc/0.10.2@osp/stable -b missing -o "libcosim:proxyfmu=True"
conan upload --all --confirm --remote osp '*'
- name: 'Run test'
run: |
pip install .
Expand All @@ -38,36 +53,37 @@ jobs:
CONAN_REVISIONS_ENABLED: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build and twine
run: pip install build twine
- name: Upgrade pkginfo
run: pip install --upgrade pkginfo>=1.10.0
- name: Run build
run: python -m build
- name: Build wheels
uses: pypa/[email protected]
- name: Build source
run: python -m build --sdist --outdir wheelhouse
- name: Run twine check
run: twine check --strict dist/*
run: twine check --strict wheelhouse/*
- uses: actions/upload-artifact@v3
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
name: Upload artifact (source)
with:
name: source
path: ./dist/*.tar.gz
path: ./wheelhouse/*.tar.gz
- uses: actions/upload-artifact@v3
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
name: Upload artifact (wheels)
with:
name: wheels
path: ./dist/*.whl
path: ./wheelhouse/*.whl

publish:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs:
- build
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
Loading

0 comments on commit 1f43ece

Please sign in to comment.