Skip to content

Commit

Permalink
Improve doc build (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbalioglu authored Sep 5, 2023
1 parent f461eab commit 55d0b61
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/_build_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
on:
workflow_call:
inputs:
torch:
type: string
default: '2.0.1'
py:
type: string
default: '3.11'
version_overwrite:
type: string
default: ''

env:
TORCH: '2.0.1'
PY: '3.11'

defaults:
run:
shell: bash
Expand All @@ -33,12 +35,12 @@ jobs:
yum --assumeyes install libsndfile-devel
- name: Create the Python virtual environment
run: |
python$PY -m venv ~/venv
python${{ inputs.py }} -m venv ~/venv
echo ~/venv/bin >> "$GITHUB_PATH"
- name: Install PyTorch
run: |
pip install torch==$TORCH\
pip install torch==${{ inputs.torch }}\
--extra-index-url https://download.pytorch.org/whl/cpu
- name: Install Sphinx
run: |
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/_publish_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ jobs:
if [[ $version == *.dev* ]]; then
doc_dir=nightly
else
doc_dir=$version
# Ignore pre-release segment for directory name.
mmp_version=$(echo $version | grep --only-matching --extended-regexp '^([0-9]+\.)*[0-9]+' -)
doc_dir=$mmp_version
# If we have a stable release, update the 'stable' symlink.
if [[ $version == $mmp_version]]; then
ln --symbolic --no-target-directory --force $doc_dir stable
fi
fi
rsync --recursive --delete-after ~/doc/ $doc_dir
Expand Down
2 changes: 1 addition & 1 deletion tools/set-project-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function extract_pep_version
function extract_mmp_version
{
# Grep major, minor, and patch segments.
echo "$1" | grep --only-matching --extended-regexp '^([0-9]+\.)*[0-9]+'
echo "$1" | grep --only-matching --extended-regexp '^([0-9]+\.)*[0-9]+' -
}

if [[ $# -ne 1 ]]; then
Expand Down

0 comments on commit 55d0b61

Please sign in to comment.