ci
: upload fix
#95
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
name: Build and Tests (MACOS and WINDOWS) | |
on: | |
pull_request: | |
push: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, macos-14] | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
dist: [bdist_wheel] | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download test image file | |
run: | | |
# 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: Install dependencies | |
run: | | |
pip install --upgrade pip setuptools rich wheel requests pillow | |
- name: Build wheel | |
run: | | |
python setup.py ${{ matrix.dist }} | |
- name: Run tests | |
run: | | |
pip install --find-links=dist materialyoucolor --no-index | |
python tests/test_all.py test_image.jpg 1 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "artifact-cp${{ matrix.python-version }}-${{ matrix.os }}.tar.gz" | |
path: dist | |
deploy: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, macos-14] | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: "artifact-cp${{ matrix.python-version }}-${{ matrix.os }}.tar.gz" | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
skip-existing: true | |
packages_dir: dist/ | |