Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions .github/workflows/newpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,45 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Set up Python
uses: actions/setup-python@v3

- name: Build wheels
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a #v2.23.2
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
CIBW_ARCHS: auto64
CIBW_SKIP: "*-win32 *-manylinux_i686"
with:
output-dir: wheelhouse
- name: Install dependencies
run: python -m pip install --upgrade pip twine flake8

- name: Build wheels (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
for PYVER in cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
/opt/python/${PYVER}/bin/pip install cython numpy build
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
/opt/python/${PYVER}/bin/python -m build --wheel --outdir /io/wheelhouse/
done

- name: Build wheels (Windows)
if: matrix.os == 'windows-2022'
run: |
pip install cython numpy build
python -m build --wheel --outdir wheelhouse/

- name: Get wheel filename
id: wheel-name
- name: Get wheel filenames
id: wheel-names
run: |
WHEEL_NAME=$(ls ./wheelhouse/pycmsgen-*.whl | xargs -n 1 basename)
echo "wheel_name=${WHEEL_NAME}" >> $GITHUB_OUTPUT
ls ./wheelhouse/pycmsgen-*.whl | xargs -n 1 basename > wheel_names.txt
echo "wheel_names<<EOF" >> $GITHUB_OUTPUT
cat wheel_names.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/pycmsgen-*.whl
name: cmsgen-${{ matrix.os }}_${{ steps.wheel-name.outputs.wheel-name }}
name: cmsgen-${{ matrix.os }}

- name: Install twine
run: python -m pip install twine

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: "__token__"
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/python-tarball-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine flake8

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
run: |
python -m pip install build --user

- name: Build a source tarball
run: >-
python -m
build
--sdist
--outdir dist/
run: |
python -m build --sdist --outdir dist/

- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build
with:
build-requirements: 'cython numpy'
run: |
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
/opt/python/cp311-cp311/bin/pip install cython numpy
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
/opt/python/cp311-cp311/bin/python -m build --wheel --outdir /io/dist/

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: python-wheel-artifact
path: dist/*
name: python-wheel-artifact
path: dist/*

- name: Publish tarball to PyPI
env:
TWINE_USERNAME: "__token__"
Expand Down