Skip to content

Commit

Permalink
Split github actions into separated test and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pmneila committed Jul 3, 2024
1 parent 55c4190 commit abff81f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 60 deletions.
63 changes: 3 additions & 60 deletions .github/workflows/mcubes-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: PyMCubes
name: PyMCubes tests

on:
push:
branches: [master]
pull_request:

jobs:
Expand Down Expand Up @@ -36,62 +38,3 @@ jobs:
run: |
python -m pip install flake8
flake8 .
deploy-sdist:
name: Deploy source distribution
runs-on: ubuntu-latest
needs: test
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build sdist
run: python -m build --sdist
- name: Deploy sdist
run: |
python3 -m pip install twine
python3 -m twine upload --skip-existing dist/*
deploy-wheels:
name: Deploy wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: test
env:
CIBW_ARCHS: "auto64"
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* pp*"
CIBW_SKIP: "*musllinux* pp*-win* pp*-macosx*"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
if: github.ref == 'refs/heads/master'

strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.11.4
- name: Build wheels
run: python3 -m cibuildwheel --output-dir wheelhouse
- name: Deploy
run: |
python3 -m pip install twine
python3 -m twine upload --skip-existing wheelhouse/*.whl
64 changes: 64 additions & 0 deletions .github/workflows/mcubes-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: PyMCubes deployment

on:
push:
tags: 'v[0-9]+*'


jobs:
deploy-sdist:
name: Deploy source distribution
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build sdist
run: python -m build --sdist
- name: Deploy sdist
run: |
python3 -m pip install twine
python3 -m twine upload --skip-existing dist/*
deploy-wheels:
name: Deploy wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_ARCHS: "auto64"
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* pp*"
CIBW_SKIP: "*musllinux* pp*-win* pp*-macosx*"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
if: github.ref == 'refs/heads/master'

strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.11.4
- name: Build wheels
run: python3 -m cibuildwheel --output-dir wheelhouse
- name: Deploy
run: |
python3 -m pip install twine
python3 -m twine upload --skip-existing wheelhouse/*.whl

0 comments on commit abff81f

Please sign in to comment.