Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
godlygeek committed Aug 2, 2023
1 parent ffcc4d3 commit a428342
Showing 1 changed file with 75 additions and 42 deletions.
117 changes: 75 additions & 42 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,52 +95,54 @@ jobs:
name: dist
path: ./wheelhouse/*.whl

build_wheels_macos:
needs: [build_sdist]
name: Wheel for MacOS-${{ matrix.cibw_python }}-${{ matrix.cibw_arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-11]
cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_arch: ["x86_64", "arm64"]
#build_wheels_macos:
# needs: [build_sdist]
# name: Wheel for MacOS-${{ matrix.cibw_python }}-${{ matrix.cibw_arch }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [macos-11]
# cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
# cibw_arch: ["x86_64", "arm64"]

steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: actions/download-artifact@v3
with:
name: tests
path: tests
- name: Extract sdist
run: |
tar zxvf dist/*.tar.gz --strip-components=1
- name: Sets env vars for compilation
if: matrix.cibw_arch == 'arm64'
run: |
echo "CFLAGS=-target arm64-apple-macos11" >> $GITHUB_ENV
echo "MEMRAY_LIBBACKTRACE_TARGET=arm64-apple-macos11" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
CIBW_PRERELEASE_PYTHONS: True
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_BUILD_VERBOSITY: 1
MACOSX_DEPLOYMENT_TARGET: "10.14"
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: dist
# path: dist
# - uses: actions/download-artifact@v3
# with:
# name: tests
# path: tests
# - name: Extract sdist
# run: |
# tar zxvf dist/*.tar.gz --strip-components=1
# - name: Sets env vars for compilation
# if: matrix.cibw_arch == 'arm64'
# run: |
# echo "CFLAGS=-target arm64-apple-macos11" >> $GITHUB_ENV
# echo "MEMRAY_LIBBACKTRACE_TARGET=arm64-apple-macos11" >> $GITHUB_ENV
# - name: Build wheels
# uses: pypa/[email protected]
# env:
# CIBW_BUILD: ${{ matrix.cibw_python }}
# CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
# CIBW_PRERELEASE_PYTHONS: True
# CIBW_TEST_EXTRAS: test
# CIBW_TEST_COMMAND: pytest {package}/tests
# CIBW_BUILD_VERBOSITY: 1
# MACOSX_DEPLOYMENT_TARGET: "10.14"

- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl
# - uses: actions/upload-artifact@v3
# with:
# name: dist
# path: ./wheelhouse/*.whl

upload_pypi:
needs: [build_wheels, build_wheels_macos, build_sdist]
needs:
[build_wheels, build_sdist]
#needs: [build_wheels, build_wheels_macos, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
Expand All @@ -156,3 +158,34 @@ jobs:
with:
skip_existing: true
password: ${{ secrets.PYPI_PASSWORD }}

publish_docs:
name: Publish docs
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Install Python dependencies
run: |
python3 -m pip install -r requirements-extra.txt
- name: Install Package
run: |
python3 -m pip install --no-index --find-links=dist/ --only-binary=memray memray
- name: Build docs
run: |
make docs
- name: Publish docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/_build/html
single-commit: true

0 comments on commit a428342

Please sign in to comment.