Skip to content

Commit

Permalink
Publish to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Dynamos committed Jan 13, 2024
1 parent 5929e5f commit 05fabe8
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 38 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and Tests (MACOS and WINDOWS)

on:
pull_request:
push:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
dist: [bdist_wheel]
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: |
pip install --upgrade pip setuptools rich pybind11 wheel requests
- name: Build wheel
run: |
python setup.py ${{ matrix.dist }}
- name: Run tests
run: |
pip install --find-links=dist materialyoucolor
python tests/test_color_gen.py test_image.jpg 1
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
deploy:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: dist/
51 changes: 51 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Tests (LINUX)

on:
pull_request:
push:

jobs:
build:
runs-on: ['ubuntu-latest']
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 pybind11 wheel requests
/opt/python/cp310-cp310/bin/pip install --upgrade pip setuptools rich pybind11 wheel requests
/opt/python/cp311-cp311/bin/pip install --upgrade pip setuptools rich pybind11 wheel requests
/opt/python/cp312-cp312/bin/pip install --upgrade pip setuptools rich pybind11 wheel requests
- 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
- 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_color_gen.py test_image.jpg 1
/opt/python/cp310-cp310/bin/python tests/test_color_gen.py test_image.jpg 1
/opt/python/cp311-cp311/bin/python tests/test_color_gen.py test_image.jpg 1
/opt/python/cp312-cp312/bin/python tests/test_color_gen.py test_image.jpg 1
/opt/python/cp39-cp39/bin/pip install auditwheel
auditwheel repair dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: wheelhouse
38 changes: 0 additions & 38 deletions .github/workflows/python-publish.yml

This file was deleted.

0 comments on commit 05fabe8

Please sign in to comment.