diff --git a/.github/workflows/deploy-python.yml b/.github/workflows/deploy-python.yml new file mode 100644 index 000000000..575545835 --- /dev/null +++ b/.github/workflows/deploy-python.yml @@ -0,0 +1,86 @@ +# Copyright 2010 New Relic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Deploy + +on: + release: + types: + - published + +jobs: + deploy-linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + architecture: x64 + + - name: Install Dependencies + run: | + pip install -U pip + pip install -U wheel setuptools twine + + - name: Build Source Package + run: python setup.py sdist + + - name: Build Manylinux Wheels (Python 2) + uses: pypa/cibuildwheel@v1.12.0 + env: + CIBW_PLATFORM: linux + CIBW_BUILD: cp27-manylinux_x86_64 + CIBW_ARCHS: x86_64 + 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" + CIBW_TEST_REQUIRES: beautifulsoup4 + CIBW_TEST_COMMAND: "pip install -r {package}/tests/base_requirements.txt && export PYTHONPATH={package}/tests && NEW_RELIC_APDEX_T=1000 pytest -vx {package}/tests/agent_features/ && pytest -vx {package}/tests/agent_unittests/" + + - name: Build Manylinux Wheels (Python 3) + uses: pypa/cibuildwheel@v2.0.1 + env: + CIBW_PLATFORM: linux + CIBW_BUILD: cp36-manylinux_aarch64 cp37-manylinux_aarch64 cp38-manylinux_aarch64 cp39-manylinux_aarch64 cp36-manylinux_x86_64 cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 + CIBW_ARCHS: x86_64 aarch64 + 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" + CIBW_TEST_REQUIRES: beautifulsoup4 + CIBW_TEST_COMMAND: "pip install -r {package}/tests/base_requirements.txt && export PYTHONPATH={package}/tests && NEW_RELIC_APDEX_T=1000 pytest -vx {package}/tests/agent_features/ && pytest -vx {package}/tests/agent_unittests/" + + - name: Upload Package to S3 + run: | + tarball="$(python setup.py --fullname).tar.gz" + md5_file=$(mktemp) + openssl md5 -binary dist/$tarball | xxd -p | tr -d '\n' > $md5_file + aws s3 cp $md5_file $S3_DST/${tarball}.md5 + aws s3 cp dist/$tarball $S3_DST/$tarball + env: + S3_DST: s3://nr-downloads-main/python_agent/release + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-west-2 + + - name: Upload Package to PyPI + run: | + twine upload --non-interactive dist/*.tar.gz wheelhouse/*-manylinux*.whl + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 3802f4693..000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2010 New Relic, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Deploy - -on: - release: - types: - - published - -jobs: - deploy-linux: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - persist-credentials: false - fetch-depth: 0 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v1 - - - uses: actions/setup-python@v2 - with: - python-version: '3.x' - architecture: x64 - - - name: Install Dependencies - run: | - pip install -U pip - pip install -U wheel setuptools twine - - - name: Build Source Package - run: python setup.py sdist - - - name: Build Manylinux Wheels (Python 2) - uses: pypa/cibuildwheel@v1.12.0 - env: - CIBW_PLATFORM: linux - CIBW_BUILD: cp27-manylinux_x86_64 - CIBW_ARCHS: x86_64 - 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" - CIBW_TEST_REQUIRES: beautifulsoup4 - CIBW_TEST_COMMAND: "pip install -r {package}/tests/base_requirements.txt && export PYTHONPATH={package}/tests && NEW_RELIC_APDEX_T=1000 pytest -vx {package}/tests/agent_features/ && pytest -vx {package}/tests/agent_unittests/" - - - name: Build Manylinux Wheels (Python 3) - uses: pypa/cibuildwheel@v2.0.1 - env: - CIBW_PLATFORM: linux - CIBW_BUILD: cp36-manylinux_aarch64 cp37-manylinux_aarch64 cp38-manylinux_aarch64 cp39-manylinux_aarch64 cp36-manylinux_x86_64 cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 - CIBW_ARCHS: x86_64 aarch64 - 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" - CIBW_TEST_REQUIRES: beautifulsoup4 - CIBW_TEST_COMMAND: "pip install -r {package}/tests/base_requirements.txt && export PYTHONPATH={package}/tests && NEW_RELIC_APDEX_T=1000 pytest -vx {package}/tests/agent_features/ && pytest -vx {package}/tests/agent_unittests/" - - - name: Upload Package to S3 - run: | - tarball="$(python setup.py --fullname).tar.gz" - md5_file=$(mktemp) - openssl md5 -binary dist/$tarball | xxd -p | tr -d '\n' > $md5_file - aws s3 cp $md5_file $S3_DST/${tarball}.md5 - aws s3 cp dist/$tarball $S3_DST/$tarball - env: - S3_DST: s3://nr-downloads-main/python_agent/release - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-west-2 - - - name: Upload Package to PyPI - run: | - twine upload --non-interactive dist/*.tar.gz dist/*-manylinux*.whl - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.gitignore b/.gitignore index a8f373569..8294e2fa4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ parts/ sdist/ var/ wheels/ +wheelhouse/ share/python-wheels/ *.egg-info/ .installed.cfg