2020 - published
2121
2222jobs :
23- deploy -linux :
23+ build -linux-py3 :
2424 runs-on : ubuntu-latest
25+ strategy :
26+ fail-fast : true
27+ matrix :
28+ wheel :
29+ - cp37-manylinux
30+ - cp37-musllinux
31+ - cp38-manylinux
32+ - cp38-musllinux
33+ - cp39-manylinux
34+ - cp39-musllinux
35+ - cp310-manylinux
36+ - cp310-musllinux
37+ - cp311-manylinux
38+ - cp311-musllinux
39+ - cp312-manylinux
40+ - cp312-musllinux
2541
2642 steps :
27- - uses : actions/checkout@v3
43+ - uses : actions/checkout@v4
2844 with :
2945 persist-credentials : false
3046 fetch-depth : 0
3147
3248 - name : Setup QEMU
33- uses : docker/setup-qemu-action@v1
49+ uses : docker/setup-qemu-action@v3
3450
51+ - name : Build Wheels
52+ 53+ env :
54+ CIBW_PLATFORM : linux
55+ CIBW_BUILD : " ${{ matrix.wheel }}*"
56+ CIBW_ARCHS_LINUX : x86_64 aarch64
57+ CIBW_ENVIRONMENT : " LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib"
58+ CIBW_TEST_REQUIRES : pytest
59+ CIBW_TEST_COMMAND : " PYTHONPATH={project}/tests pytest {project}/tests/agent_unittests -vx"
60+
61+ - name : Upload Artifacts
62+ 63+ with :
64+ name : ${{ github.job }}-${{ matrix.wheel }}
65+ path : ./wheelhouse/*.whl
66+ retention-days : 1
67+
68+ build-linux-py2 :
69+ runs-on : ubuntu-latest
70+
71+ steps :
72+ - uses : actions/checkout@v4
73+ with :
74+ persist-credentials : false
75+ fetch-depth : 0
76+
77+ - name : Setup QEMU
78+ uses : docker/setup-qemu-action@v3
79+
80+ - name : Build Wheels
81+ 82+ env :
83+ CIBW_PLATFORM : linux
84+ CIBW_BUILD : cp27-manylinux_x86_64
85+ CIBW_ARCHS_LINUX : x86_64
86+ CIBW_ENVIRONMENT : " LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib"
87+ CIBW_TEST_REQUIRES : pytest==4.6.11
88+ CIBW_TEST_COMMAND : " PYTHONPATH={project}/tests pytest {project}/tests/agent_unittests -vx"
89+
90+ - name : Upload Artifacts
91+ 92+ with :
93+ name : ${{ github.job }}
94+ path : ./wheelhouse/*.whl
95+ retention-days : 1
96+
97+ build-sdist :
98+ runs-on : ubuntu-latest
99+ steps :
100+ - uses : actions/checkout@v4
101+ with :
102+ persist-credentials : false
103+ fetch-depth : 0
104+
105+ - name : Install Dependencies
106+ run : |
107+ pip install -U pip
108+ pip install -U setuptools
109+
110+ - name : Build Source Package
111+ run : |
112+ python setup.py sdist
113+
114+ - name : Prepare MD5 Hash File
115+ run : |
116+ tarball="$(python setup.py --fullname).tar.gz"
117+ md5_file=${tarball}.md5
118+ openssl md5 -binary dist/${tarball} | xxd -p | tr -d '\n' > dist/${md5_file}
119+
120+ - name : Upload Artifacts
121+ 122+ with :
123+ name : ${{ github.job }}-sdist
124+ path : |
125+ ./dist/*.tar.gz
126+ ./dist/*.tar.gz.md5
127+ retention-days : 1
128+
129+ deploy :
130+ runs-on : ubuntu-latest
131+
132+ needs :
133+ - build-linux-py3
134+ - build-linux-py2
135+ - build-sdist
136+
137+ steps :
35138 - uses : actions/setup-python@v2
36139 with :
37140 python-version : " 3.x"
@@ -42,32 +145,22 @@ jobs:
42145 pip install -U pip
43146 pip install -U wheel setuptools twine
44147
45- - name : Build Source Package
46- run : python setup.py sdist
47-
48- - name : Build Manylinux Wheels (Python 2)
49- 50- env :
51- CIBW_PLATFORM : linux
52- CIBW_BUILD : cp27-manylinux_x86_64
53- CIBW_ARCHS : x86_64
54- CIBW_ENVIRONMENT : " LD_LIBRARY_PATH=/opt/rh/=vtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib"
148+ - name : Download Artifacts
149+ 150+ with :
151+ path : ./artifacts/
55152
56- - name : Build Manylinux Wheels (Python 3)
57- 58- env :
59- CIBW_PLATFORM : linux
60- CIBW_BUILD : cp37-manylinux* cp38-manylinux* cp39-manylinux* cp310-manylinux* cp311-manylinux*
61- CIBW_ARCHS : x86_64 aarch64
62- CIBW_ENVIRONMENT : " LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib"
153+ - name : Unpack Artifacts
154+ run : |
155+ mkdir -p dist/
156+ mv artifacts/**/*{.whl,.tar.gz,.tar.gz.md5} dist/
63157
64158 - name : Upload Package to S3
65159 run : |
66160 tarball="$(python setup.py --fullname).tar.gz"
67- md5_file=$(mktemp)
68- openssl md5 -binary dist/$tarball | xxd -p | tr -d '\n' > $md5_file
69- aws s3 cp $md5_file $S3_DST/${tarball}.md5
70- aws s3 cp dist/$tarball $S3_DST/$tarball
161+ md5_file=${tarball}.md5
162+ aws s3 cp dist/${md5_file} $S3_DST/${md5_file}
163+ aws s3 cp dist/${tarball} $S3_DST/${tarball}
71164 env :
72165 S3_DST : s3://nr-downloads-main/python_agent/release
73166 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
76169
77170 - name : Upload Package to PyPI
78171 run : |
79- twine upload --non-interactive dist/*.tar.gz wheelhouse/*-manylinux *.whl
172+ twine upload --non-interactive dist/*.tar.gz dist/ *.whl
80173 env :
81174 TWINE_USERNAME : __token__
82175 TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
0 commit comments