Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #12

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #12

name: PyPI publish
on:
push:
jobs:
packages:
name: Wheels on ${{ matrix.os }} (${{ matrix.cibw_archs }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
cibw_archs: ["auto"]
env:
CIBW_SKIP: "*-musllinux_* cp36-* pp3*-win_*"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Setup conda (windows-latest)
if: matrix.os == 'windows-latest'
uses: s-weigand/setup-conda@v1
- name: Setup conda paths (windows-latest)
if: matrix.os == 'windows-latest'
run: |
echo "LIBRARY_DIRS=C:\Miniconda\Library\lib;C:\Miniconda\Library\bin" >> $env:GITHUB_ENV
echo "INCLUDE_DIRS=C:\Miniconda\Library\include" >> $env:GITHUB_ENV
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.13.1
- name: Build wheels
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: '{cp,pp}3*'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_ALL_LINUX: yum -y install epel-release hdf hdf-devel && ln -s /usr/lib64/hdf/lib* /usr/lib64/
CIBW_ARCHS_LINUX: 'x86_64' # restrict to 64bit builds
CIBW_ARCHS_WINDOWS: 'AMD64' # restrict to 64bit builds
# (mac-os) Install hdf4 from sources
CIBW_BEFORE_ALL_MACOS: >
brew install ninja &&
cd /tmp &&
git clone --depth 1 --branch hdf-4_2_16 https://github.com/HDFGroup/hdf4.git &&
mkdir build && cd build &&
../hdf4/configure --enable-hdf4-xdr --enable-shared --disable-static --disable-fortran --disable-netcdf --enable-production --with-zlib --prefix=/usr/local &&
make install
CIBW_BEFORE_ALL_WINDOWS: >
conda config --set always_yes yes --set changeps1 no --set auto_update_conda no --set safety_checks disabled &&
conda install -q hdf4
- name: Copy wheels into wheelhouse
run: |
mkdir wheelhouse
cp dist/*.whl wheelhouse
- uses: actions/upload-artifact@v2
with:
name: wheelhouse
path: wheelhouse
publish:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Publish to PyPI
needs: [packages]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Switch to using Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Create source distribution archive
run: |
python -m pip install build
python -m build --sdist -o wheelhouse
- uses: actions/upload-artifact@v2
with:
name: wheelhouse
path: wheelhouse
- name: Publish SDIST to PyPI # there are some problems if sdist is not pushed first
if: github.event.base_ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/
- name: Download all the wheels
uses: actions/download-artifact@v4.1.7
with:
name: wheelhouse
path: ./wheelhouse/
- name: Publish a Python distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: wheelhouse/
verbose: true
- name: Publish a Python distribution to PyPI
if: github.event.base_ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/