Skip to content

Workflow file for this run

name: Release
on:
release:
types: [ released ]
env:
MODULE_NAME: imops
jobs:
check_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- id: get_version
name: Get the release version
uses: Simply007/get-version-action@v2
- name: Check the version
run: |
RELEASE=${{ steps.get_version.outputs.version-without-v }}
VERSION=$(python -c "from pathlib import Path; import runpy; folder, = {d.parent for d in Path().resolve().glob('*/__init__.py') if d.parent.is_dir() and (d.parent / '__version__.py').exists()}; print(runpy.run_path(folder / '__version__.py')['__version__'])")
MATCH=$(pip index versions $MODULE_NAME | grep "Available versions:" | grep $VERSION) || echo
echo $MATCH
if [ "$GITHUB_BASE_REF" = "master" ] && [ "$MATCH" != "" ]; then echo "Version $VERSION already present" && exit 1; fi
if [ "$VERSION" != "$RELEASE" ]; then echo "$VERSION vs $RELEASE" && exit 1; fi
build_wheels:
needs: [ check_version ]
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019, macOS-11 ]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.10.0
- name: Install gcc for mac
if: matrix.os == 'macOS-11'
run: |
brew install llvm libomp
echo $PATH
ln -sf /usr/local/bin/gcc-12 /usr/local/bin/gcc
ls /usr/local/bin/gcc*
gcc --version
- name: Build wheels
run: |
python -m pip install --upgrade pip
python -m cibuildwheel --output-dir wheelhouse
env:

Check failure on line 60 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

You have an error in your yaml syntax on line 60
CIBW_ENVIRONMENT_MACOS: >
PATH="/usr/local/opt/llvm/bin:$PATH" LDFLAGS="-L/usr/local/opt/llvm/lib" CPPFLAGS="-I/usr/local/opt/llvm/include"
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-*
CIBW_BEFORE_BUILD: 'if [ $(python -c 'import sys; print(sys.version_info[1])') -lt 9 ]; then python -m pip install "numpy<2.0.0" --config-settings=setup-args="-Dallow-noblas=true"; fi'
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
needs: [ check_version ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Build
run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
release:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}