Skip to content

Commit

Permalink
ci: Automatically publish docs for new releases
Browse files Browse the repository at this point in the history
On each new release, automatically build our docs and publish them to
GitHub Pages. The docs are also built by our linting workflow, but we
don't attempt to reuse that build here, because the linting build runs
`towncrier` with a phony version number in order to exercise the news
fragments in the news/ directory, and we don't want that fake version in
the changelog we publish.

Signed-off-by: Matt Wozniski <[email protected]>
  • Loading branch information
godlygeek committed Aug 2, 2023
1 parent 7216edf commit bb3262c
Showing 1 changed file with 43 additions and 44 deletions.
87 changes: 43 additions & 44 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,54 +95,52 @@ 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_sdist]
#needs: [build_wheels, build_wheels_macos, 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 @@ -162,6 +160,7 @@ jobs:
publish_docs:
name: Publish docs
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
contents: write
steps:
Expand Down

0 comments on commit bb3262c

Please sign in to comment.