Skip to content

Commit

Permalink
ci: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Dynamos committed Jan 9, 2025
1 parent 147ea14 commit 79f58a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
python setup.py ${{ matrix.dist }}
- name: Run tests
run: |
pip install --find-links=dist materialyoucolor
pip install --find-links=dist materialyoucolor --no-index
python tests/test_all.py test_image.jpg 1
- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
runs-on: ['ubuntu-latest']
container:
image: quay.io/pypa/manylinux_2_28_x86_64
strategy:
matrix:
python-version: [cp39, cp310, cp311, cp312]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Expand All @@ -18,38 +21,34 @@ jobs:
uses: actions/checkout@v2
- name: Install dependencies
run: |
/opt/python/cp39-cp39/bin/pip install --upgrade pip setuptools rich wheel requests pillow
/opt/python/cp310-cp310/bin/pip install --upgrade pip setuptools rich wheel requests pillow
/opt/python/cp311-cp311/bin/pip install --upgrade pip setuptools rich wheel requests pillow
/opt/python/cp312-cp312/bin/pip install --upgrade pip setuptools rich wheel requests pillow
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/pip install --upgrade pip setuptools rich wheel requests pillow
- name: Build wheel
run: |
/opt/python/cp39-cp39/bin/python setup.py bdist_wheel
/opt/python/cp310-cp310/bin/python setup.py bdist_wheel
/opt/python/cp311-cp311/bin/python setup.py bdist_wheel
/opt/python/cp312-cp312/bin/python setup.py bdist_wheel sdist
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/python setup.py bdist_wheel
# Only run sdist for the latest python version
if [ "${{ matrix.python-version }}" == "cp312" ]; then
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/python setup.py bdist_wheel sdist
fi
- name: Run tests
run: |
/opt/python/cp39-cp39/bin/pip install --find-links=dist materialyoucolor
/opt/python/cp310-cp310/bin/pip install --find-links=dist materialyoucolor
/opt/python/cp311-cp311/bin/pip install --find-links=dist materialyoucolor
/opt/python/cp312-cp312/bin/pip install --find-links=dist materialyoucolor
/opt/python/cp39-cp39/bin/python tests/test_all.py test_image.jpg 1
/opt/python/cp310-cp310/bin/python tests/test_all.py test_image.jpg 1
/opt/python/cp311-cp311/bin/python tests/test_all.py test_image.jpg 1
/opt/python/cp312-cp312/bin/python tests/test_all.py test_image.jpg 1
/opt/python/cp39-cp39/bin/pip install auditwheel
mkdir wheelhouse
mv dist/*.tar.gz wheelhouse
auditwheel repair dist/*
echo "Built dists:"
ls wheelhouse
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/pip install --find-links=dist materialyoucolor --no-index
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/python tests/test_all.py test_image.jpg 1
- name: Audit and move built distributions
run: |
# Run auditwheel only for Python 3.9
if [ "${{ matrix.python-version }}" == "cp39" ]; then
/opt/python/${{ matrix.python-version }}-${{ matrix.python-version }}.bin/pip install auditwheel
mkdir wheelhouse
mv dist/*.tar.gz wheelhouse
auditwheel repair dist/*
echo "Built dists:"
ls wheelhouse
fi
- name: Publish to PyPI
uses: pypa/[email protected]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: wheelhouse

0 comments on commit 79f58a2

Please sign in to comment.