Skip to content

Commit 8687937

Browse files
committed
ci: produce manylinux compliant package
1 parent cc959af commit 8687937

2 files changed

Lines changed: 30 additions & 15 deletions

File tree

.github/actions/libvmi-setup/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ author: 'Mathieu Tarral'
44
runs:
55
using: 'composite'
66
steps:
7+
- name: Ensure sudo is available (manylinux container compat)
8+
shell: bash
9+
run: |
10+
if [ "$EUID" -eq 0 ]; then
11+
apt-get update && apt-get install -y sudo
12+
fi
13+
714
- name: install dependencies
815
shell: bash
916
run: sudo apt-get update && sudo apt-get install -qq cmake bison flex check libjson-c-dev libglib2.0-dev libxenstore3.0 libxen-dev libvirt-dev

.github/workflows/ci.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,36 +60,44 @@ jobs:
6060
python setup.py bdist_wheel
6161
working-directory: python-libvmi
6262

63+
- name: upload build artifact
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: ${{ matrix.python }}
67+
path: "python-libvmi/dist/*.whl"
68+
69+
6370
publish:
64-
needs: build
6571
runs-on: ubuntu-latest
72+
needs: [build]
73+
container: quay.io/pypa/manylinux_2_24_x86_64
74+
strategy:
75+
matrix:
76+
python: ['3.6', '3.7', '3.8', '3.9']
6677

67-
# if push on master and tag is 'v*'
68-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
6978
steps:
70-
- uses: actions/checkout@v1
79+
- uses: actions/checkout@v2
7180
with:
7281
path: python-libvmi
7382

7483
- name: Install Libvmi
7584
uses: ./python-libvmi/.github/actions/libvmi-setup
7685

77-
- name: Set up Python 3.7 🐍
78-
uses: actions/setup-python@v1
86+
# download artifact in current directory
87+
- name: download build artifact
88+
uses: actions/download-artifact@v3
7989
with:
80-
python-version: '3.7'
90+
name: ${{ matrix.python }}
8191

82-
- name: Build 🔨
92+
- name: Repair Wheels
8393
run: |
84-
python -m pip install wheel
85-
python setup.py sdist
86-
python setup.py bdist_wheel
87-
working-directory: python-libvmi
94+
for whl in *.whl; do
95+
auditwheel repair "$whl" -w manylinux
96+
done
8897
8998
- name: Publish on PyPI 🚀
90-
uses: pypa/gh-action-pypi-publish@v1.3.1
99+
uses: pypa/gh-action-pypi-publish@v1.5.0
91100
with:
92101
user: __token__
93102
password: ${{ secrets.ACCESS_TOKEN }}
94-
packages_dir: python-libvmi/dist
95-
103+
packages_dir: manylinux

0 commit comments

Comments
 (0)