Build docu even without publishing to pypi #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, macos-13, windows-latest] | |
include: | |
- os: windows-2019 | |
cibw-arch: AMD64 | |
cmake-generator: "Visual Studio 16 2019" | |
cmake_generator_platform: "x64" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
fetch-tags: 'true' | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.19.0 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
6F0F | build_sdist: |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
fetch-tags: 'true' | |
fetch-depth: 0 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
publish-pypi: | |
name: Publish to PyPI | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v2 | |
with: | |
name: python-package-distributions | |
path: ./wheelhouse/ | |
- name: Publish binary distributions to PyPI | |
if: github.ref == 'refs/heads/master' | |
#if: github.event_name == 'release' && github.event.action == 'created' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: ./wheelhouse/ | |
docs: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
submodules: 'False' | |
path: '.' | |
- uses: actions/download-artifact@v4 | |
with: | |
# unpacks all CIBW artifacts into dist/ | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: apt-get | |
run: sudo apt-get update && DEBIAN_FRONTEND="noninteractive" sudo apt-get -y install python3-testresources npm nodejs pandoc -y | |
- name: pip install requirements | |
run: | |
pip install --user -r ./docs/requirements.txt | |
pip install --user ./dist/*manylinux*.whl | |
- name: webgui | |
run: | | |
pip install jupyter_contrib_nbextensions | |
jupyter contrib nbextension install --user | |
jupyter nbextension install --user --py widgetsnbextension | |
jupyter nbextension enable --user --py widgetsnbextension | |
jupyter nbextension install --user --py webgui_jupyter_widgets | |
jupyter nbextension enable --user --py webgui_jupyter_widgets | |
- name: Build and Commit | |
uses: sphinx-notes/pages@v2 | |
with: | |
repository_path: '.' | |
publish: false | |
#requirements_path: ./doc/requirements.txt | |
- name: Upload | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'ngstents' | |
deploy-docs: | |
needs: docs | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
#if: github.ref == 'refs/heads/master' | |
if: github.event_name == 'release' && github.event.action == 'created' | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |