-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
49 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
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 |
---|---|---|
|
@@ -10,46 +10,39 @@ jobs: | |
container: | ||
image: quay.io/pypa/manylinux_2_28_x86_64 | ||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Checkout code | ||
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 | ||
- name: Build wheel | ||
- name: Download test image file | ||
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 | ||
- name: Run tests | ||
# Photo by Dillon Hunt (https://unsplash.com/@dillon_hunt) on https://unsplash.com/photos/an-aerial-view-of-the-ocean-and-rocks-zQLd8RXbenw | ||
curl -L -o test_image.jpg "https://unsplash.com/photos/zQLd8RXbenw/download?ixid=M3wxMjA3fDB8MXx0b3BpY3x8NnNNVmpUTFNrZVF8fHx8fDJ8fDE3MzY0MDA3NTd8&force=true&w=2400" | ||
- name: Setup, Build, Test and Audit | ||
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 | ||
python_versions=("cp39" "cp310" "cp311" "cp312" "cp313") | ||
for version in "${python_versions[@]}"; do | ||
/opt/python/$version-$version/bin/pip install --upgrade pip setuptools rich wheel requests pillow | ||
/opt/python/$version-$version/bin/python setup.py bdist_wheel | ||
/opt/python/$version-$version/bin/pip install --find-links=dist materialyoucolor --no-index | ||
/opt/python/$version-$version/bin/python tests/test_all.py test_image.jpg 1 &> /dev/null | ||
if [ "$version" == "cp39" ]; then | ||
/opt/python/$version-$version/bin/python setup.py sdist | ||
/opt/python/$version-$version/bin/pip install auditwheel | ||
mkdir wheelhouse | ||
mv dist/*.tar.gz wheelhouse | ||
auditwheel repair dist/* | ||
echo "Built dists for Python $version:" | ||
ls wheelhouse | ||
fi | ||
done | ||
/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 | ||
- 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 | ||
|
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