Update github links (#44) #195
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-docs | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| doc-build: | |
| runs-on: ubuntu-latest | |
| env: | |
| DISPLAY: ":99" | |
| OPENBLAS_NUM_THREADS: 4 | |
| MNE_3D_BACKEND: pyvista | |
| _MNE_BRAIN_TRACES_AUTO: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Merge with upstream | |
| run: | | |
| echo $(git log -1 --pretty=%B) | tee gitlog.txt | |
| echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt | |
| if [[ $(cat merge.txt) != "" ]]; then | |
| echo "Merging $(cat merge.txt)"; | |
| git remote add upstream git://github.com/wmvanvliet/mne-rsa.git; | |
| git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge"; | |
| git fetch upstream main; | |
| fi | |
| - name: Install 3D rendering libraries | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libosmesa6 libglx-mesa0 libopengl0 libglx0 libdbus-1-3 | |
| - name: Spin up Xvfb | |
| run: | | |
| /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; | |
| - name: Install PyQt6 dependencies | |
| run: | | |
| sudo apt-get install qt6-base-dev libx11-xcb-dev libxcb-cursor0 | |
| - name: Cache Pip | |
| id: cache-pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: pip-cache | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --user --upgrade --progress-bar off pip wheel | |
| python -m pip install --user --upgrade --progress-bar off -r requirements-dev.txt | |
| python -m pip install --user -e . | |
| # Look at what we have and fail early if there is some library conflict | |
| - name: Check installation | |
| run: | | |
| which python | |
| python -c "import mne; mne.sys_info()" | |
| python -c "import numpy; numpy.show_config()" | |
| python -c "import mne_rsa" | |
| - name: Download example data | |
| run: | | |
| python -c "import mne; mne.datasets.sample.data_path(download=True)" | |
| python -c "import mne; mne.datasets.kiloword.data_path(download=True)" | |
| # Build docs | |
| - name: make html | |
| run: | | |
| cd doc; | |
| make html; | |
| - name: Save HTML as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doc-dev | |
| path: doc/_build/html | |
| doc-deploy-dev: | |
| if: github.event_name == 'push' | |
| needs: doc-build | |
| name: deploy development documentation | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: doc-dev | |
| path: ./doc-dev | |
| - uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: ./doc-dev | |
| target-folder: ./dev | |
| git-config-name: 'github-actions[bot]' | |
| git-config-email: 'github-actions[bot]@users.noreply.github.com' | |
| single-commit: true | |
| force: true | |
| doc-deploy-release: | |
| if: github.event_name == 'release' | |
| needs: doc-build | |
| name: deploy stable documentation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: doc-dev | |
| path: ./doc-dev | |
| - name: Get previous release tag | |
| run: | | |
| PREVIOUS_RELEASE_TAG=$(git tag --sort=-creatordate | sed "/^$RELEASE_TAG$/d" | sed -n 1p) | |
| if [ -z "$PREVIOUS_RELEASE_TAG" ]; then | |
| echo "No previous release tag found." | |
| exit 1 | |
| fi | |
| echo "Previous release tag: $PREVIOUS_RELEASE_TAG" | |
| echo "PREVIOUS_RELEASE_TAG=$PREVIOUS_RELEASE_TAG" >> $GITHUB_ENV | |
| env: | |
| RELEASE_TAG: ${{ github.event.release.tag_name }} | |
| - name: Move stable to previous release tag | |
| run: | | |
| if [ -d "stable" ]; then | |
| if [ -d "$PREVIOUS_RELEASE_TAG" ]; then | |
| echo "Folder $PREVIOUS_RELEASE_TAG already exists. Exiting." | |
| exit 1 | |
| fi | |
| git mv stable "$PREVIOUS_RELEASE_TAG" | |
| else | |
| echo "No stable folder found." | |
| exit 1 | |
| fi | |
| - run: mv doc-dev stable | |
| - run: rm -rf dev && cp -r stable dev | |
| if: github.event.release.target_commitish == 'main' | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add . | |
| git commit -m "update documentation for release ${{ github.event.release.tag_name }}" | |
| git push origin gh-pages | |