-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GHA pypi-publish and UDUNITS2 XML read (#196)
* Fix GHA pypi-publish and UDUNITS2 XML read * add publish to pypi job * turn codecov patch off
- Loading branch information
Showing
10 changed files
with
168 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
|
||
trap 'echo "Aborted!"; exit 1' ERR | ||
set -e | ||
|
||
|
||
yum install -y udunits2-devel | ||
|
||
PYTHONS=("cp37-cp37m" "cp38-cp38" "cp39-cp39") | ||
WHEELHOUSE="/github/workspace/wheelhouse/" | ||
WHEELHOUSE="/github/workspace/wheelhouse" | ||
MANYLINUX="manylinux2014_x86_64" | ||
DISTRIBUTION="dist" | ||
|
||
export UDUNITS2_INCDIR="/usr/include/udunits2" | ||
export UDUNITS2_LIBDIR="/usr/lib64" | ||
export UDUNITS2_XML_PATH="/usr/share/udunits/udunits2.xml" | ||
|
||
# Create the distribution directory. | ||
mkdir ${DISTRIBUTION} | ||
|
||
# Build the wheels in the wheelhouse. | ||
for PYTHON in ${PYTHONS[@]}; do | ||
/opt/python/${PYTHON}/bin/pip install --upgrade pip wheel setuptools setuptools_scm build twine auditwheel | ||
/opt/python/${PYTHON}/bin/python -m build --sdist --wheel . --outdir ${WHEELHOUSE} | ||
PYBIN="/opt/python/${PYTHON}/bin/python" | ||
${PYBIN} -m pip install --upgrade pip wheel setuptools setuptools_scm build twine auditwheel | ||
${PYBIN} -m build --wheel . --outdir ${WHEELHOUSE} | ||
done | ||
|
||
# Build the sdist in the distribution. | ||
${PYBIN} -m build --sdist . --outdir ${DISTRIBUTION} | ||
|
||
# Convert to manylinux wheels in the wheelhouse. | ||
for BDIST_WHEEL in ${WHEELHOUSE}/cf_units*.whl; do | ||
auditwheel repair ${BDIST_WHEEL} | ||
done | ||
|
||
# Populate distribution with the manylinux wheels. | ||
cp ${WHEELHOUSE}/cf_units*${MANYLINUX}.whl ${DISTRIBUTION} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: 'build wheels with manylinux2014_x86_64' | ||
description: 'build wheels with manylinux2014_x86_64' | ||
runs: | ||
using: 'docker' | ||
image: docker://quay.io/pypa/manylinux2014_x86_64 | ||
args: | ||
- .github/workflows/actions/entrypoint.sh |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: pypi-publish | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build-artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get tags | ||
shell: bash | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
|
||
- name: Build linux wheels | ||
uses: ./.github/workflows/actions/manylinux2014_x86_64 | ||
|
||
- name: List built artifacts | ||
shell: bash | ||
working-directory: dist | ||
run: ls | ||
|
||
- name: Check built artifacts | ||
shell: bash | ||
working-directory: dist | ||
run: | | ||
python -m pip install wheel twine | ||
python -m twine check * | ||
- name: Inspect built wheels | ||
shell: bash | ||
working-directory: dist | ||
run: | | ||
for WHEEL in *.whl; do | ||
echo -e "\n${WHEEL}" | ||
python -m zipfile --list ${WHEEL} | ||
done | ||
- name: Upload built artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pypi-artifacts | ||
path: dist | ||
|
||
test-artifacts: | ||
needs: build-artifacts | ||
name: Test ${{ matrix.tag }} for Python ${{ matrix.python }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.7, 3.8, 3.9] | ||
include: | ||
- python: 3.7 | ||
tag: cp37-cp37m | ||
- python: 3.8 | ||
tag: cp38-cp38 | ||
- python: 3.9 | ||
tag: cp39-cp39 | ||
steps: | ||
- name: Download built artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: pypi-artifacts | ||
path: dist | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install ${{ matrix.tag }} | ||
env: | ||
TAG: ${{ matrix.tag }} | ||
shell: bash | ||
working-directory: dist | ||
run: python -m pip install cf_units-*-${TAG}-*.whl | ||
|
||
- name: Test ${{ matrix.tag }} | ||
shell: bash | ||
run: | | ||
python -m pip install pytest | ||
python -m pytest --pyargs cf_units | ||
publish-artifacts: | ||
needs: [build-artifacts, test-artifacts] | ||
name: Publish built artifacts to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download built artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: pypi-artifacts | ||
path: dist | ||
|
||
- name: Publish artifacts | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
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
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
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
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
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