-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to avoid getting and exporting conan installation folder.
- Loading branch information
Showing
1 changed file
with
106 additions
and
116 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,48 +9,48 @@ on: | |
- 'release**' | ||
|
||
jobs: | ||
macos-x64: | ||
name: PyPI wheels for macOS | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
python: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install dependencies | ||
run: | | ||
brew install bison flex | ||
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH | ||
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH | ||
python -m pip install --upgrade pip conan setuptools wheel | ||
- name: Build wheel | ||
run: python setup.py bdist_wheel | ||
- name: Wheel path | ||
id: wheel | ||
working-directory: pybuild/dist/ | ||
run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi-macos-py${{ matrix.python }} | ||
path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
- uses: actions/upload-release-asset@v1 | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
asset_name: ${{ steps.wheel.outputs.wheel }} | ||
asset_content_type: application/zip | ||
# macos-x64: | ||
# name: PyPI wheels for macOS | ||
# runs-on: macos-latest | ||
# strategy: | ||
# matrix: | ||
# python: | ||
# - "3.8" | ||
# - "3.9" | ||
# - "3.10" | ||
# - "3.11" | ||
# - "3.12" | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python }} | ||
# - name: Install dependencies | ||
# run: | | ||
# brew install bison flex | ||
# echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH | ||
# echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH | ||
# python -m pip install --upgrade pip conan setuptools wheel | ||
# - name: Build wheel | ||
# run: python setup.py bdist_wheel | ||
# - name: Wheel path | ||
# id: wheel | ||
# working-directory: pybuild/dist/ | ||
# run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT | ||
# - uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: pypi-macos-py${{ matrix.python }} | ||
# path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
# - uses: actions/upload-release-asset@v1 | ||
# if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ github.event.release.upload_url }} | ||
# asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
# asset_name: ${{ steps.wheel.outputs.wheel }} | ||
# asset_content_type: application/zip | ||
|
||
manylinux-x64: | ||
name: PyPI wheels for Manylinux (x64) | ||
|
@@ -77,13 +77,8 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
dnf install -y $SWIG_VERSION | ||
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python" | ||
${python_bin} -m pip install --upgrade conan wheel auditwheel | ||
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //') | ||
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#') | ||
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}" | ||
echo "Conan installation folder: ${conan_installation_folder}" | ||
echo "${conan_installation_folder}" >> $GITHUB_PATH | ||
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH" | ||
python -m pip install --upgrade conan wheel auditwheel | ||
- name: Build wheel | ||
run: | | ||
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel | ||
|
@@ -143,18 +138,13 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
dnf install -y $BISON_VERSION $FLEX_VERSION $JAVA_VERSION $SWIG_VERSION | ||
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python" | ||
${python_bin} -m pip install --upgrade pip conan wheel auditwheel | ||
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //') | ||
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#') | ||
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}" | ||
echo "Conan installation folder: ${conan_installation_folder}" | ||
echo "${conan_installation_folder}" >> $GITHUB_PATH | ||
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH" | ||
python -m pip install --upgrade pip conan wheel auditwheel | ||
- name: Build wheel | ||
run: | | ||
conan remove -c "libqasm/*" | ||
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel | ||
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl | ||
python setup.py bdist_wheel | ||
python -m auditwheel repair pybuild/dist/*.whl | ||
- name: Wheel path | ||
id: wheel | ||
working-directory: wheelhouse | ||
|
@@ -173,61 +163,61 @@ jobs: | |
asset_name: ${{ steps.wheel.outputs.wheel }} | ||
asset_content_type: application/zip | ||
|
||
windows-x64: | ||
name: PyPI wheels for Windows | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip conan setuptools wheel | ||
- name: Build wheel | ||
run: python setup.py bdist_wheel | ||
- name: Wheel path | ||
id: wheel | ||
working-directory: pybuild/dist/ | ||
run: echo "{wheel}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi-windows-py${{ matrix.python }} | ||
path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
- uses: actions/upload-release-asset@v1 | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
asset_name: ${{ steps.wheel.outputs.wheel }} | ||
asset_content_type: application/zip | ||
|
||
publish: | ||
name: Publish | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
needs: | ||
- macos-x64 | ||
- manylinux-x64 | ||
- manylinux-arm64 | ||
- windows-x64 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
id: download | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
packages_dir: ${{ steps.download.outputs.download-path }}/pypi-* | ||
# windows-x64: | ||
# name: PyPI wheels for Windows | ||
# runs-on: windows-latest | ||
# strategy: | ||
# matrix: | ||
# python: | ||
# - "3.8" | ||
# - "3.9" | ||
# - "3.10" | ||
# - "3.11" | ||
# - "3.12" | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python }} | ||
# - name: Install dependencies | ||
# run: python -m pip install --upgrade pip conan setuptools wheel | ||
# - name: Build wheel | ||
# run: python setup.py bdist_wheel | ||
# - name: Wheel path | ||
# id: wheel | ||
# working-directory: pybuild/dist/ | ||
# run: echo "{wheel}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT | ||
# - uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: pypi-windows-py${{ matrix.python }} | ||
# path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
# - uses: actions/upload-release-asset@v1 | ||
# if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ github.event.release.upload_url }} | ||
# asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} | ||
# asset_name: ${{ steps.wheel.outputs.wheel }} | ||
# asset_content_type: application/zip | ||
# | ||
# publish: | ||
# name: Publish | ||
# if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
# needs: | ||
# - macos-x64 | ||
# - manylinux-x64 | ||
# - manylinux-arm64 | ||
# - windows-x64 | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Download artifacts | ||
# uses: actions/download-artifact@v3 | ||
# id: download | ||
# - name: Publish to PyPI | ||
# uses: pypa/[email protected] | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_TOKEN }} | ||
# packages_dir: ${{ steps.download.outputs.download-path }}/pypi-* |