From bf380ea089a79d26f52b82e2fbfb7227a835140a Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Mon, 1 Apr 2024 11:55:06 -0600 Subject: [PATCH] Update sphinx version, update actions and release docs * Update actions, sphinx version and build docs for every PR * Add separate action for testing docs * Fix Release documentation * Fix typo in docs workflow Co-authored-by: Patricia Grubel --- .github/workflows/docs.yml | 48 +++++++----------------------- .github/workflows/integration.yml | 2 +- .github/workflows/publish-docs.yml | 35 ++++++++++++++++++++++ .github/workflows/pylama.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- RELEASE.rst | 11 +++++-- ci/docs.sh | 10 +++++++ pyproject.toml | 2 +- 8 files changed, 68 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/publish-docs.yml create mode 100755 ci/docs.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3ea672049..e525249d5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,44 +1,18 @@ -# Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml -name: Publish docs +name: Build Docs on: + workflow_dispatch: {} push: - branches: [main] - -# Needed for publishing to Github Pages -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true + branches: [main, develop] + pull_request: + types: [opened, synchronize, edited] + branches: [main, develop] jobs: - publish: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + docs: + name: Build Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: BEE Install - run: | - sudo apt-get update - sudo apt-get install python3 python3-venv curl build-essential \ - zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \ - libreadline-dev libffi-dev libbz2-dev libyaml-dev - curl -sSL https://install.python-poetry.org | python3 - - poetry update - poetry install - - name: Build Docs - run: | - poetry run make -C docs/sphinx html - - name: Upload - uses: actions/upload-pages-artifact@v1 - with: - path: docs/sphinx/_build/html - - name: Publish - id: deployment - uses: actions/deploy-pages@v1 + - uses: actions/checkout@v4 + - name: Install BEE and Build Docs + run: ./ci/docs.sh diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f8af883ca..f0d5162d7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -25,7 +25,7 @@ jobs: # available on 20.04 runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install and Configure run: | . ./ci/env.sh diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 000000000..c61acd031 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,35 @@ +# Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml +name: Publish docs + +on: + push: + branches: [main] + +# Needed for publishing to Github Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + publish: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: BEE Install and Build Docs + run: | + ./ci/docs.sh + - name: Upload + uses: actions/upload-pages-artifact@v1 + with: + path: docs/sphinx/_build/html + - name: Publish + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/pylama.yml b/.github/workflows/pylama.yml index 0c8cf18b4..831e5187b 100644 --- a/.github/workflows/pylama.yml +++ b/.github/workflows/pylama.yml @@ -15,7 +15,7 @@ jobs: name: PyLama Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Lint run: | pip install pylama==8.4.1 pyflakes==3.0.1 pylint==2.15.9 pydocstyle==6.1.1 2>&1 >/dev/null diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f3607b124..23d9db533 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,7 +23,7 @@ jobs: # available on 20.04 runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install and Configure run: | . ./ci/env.sh diff --git a/RELEASE.rst b/RELEASE.rst index 99dba8bf4..e894007c8 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -18,9 +18,14 @@ Verify all current changes in develop run correctly on nightly tests. 5. Once merged, on github web interface create a release and tag based on main branch that matches the version in pyproject.toml 6. Follow step 2 but uncheck Allow specified actors to bypass and don't forget save -7. Finally, on the main branch, first run a ``poetry build`` and then a - ``poetry publish``. The second command will ask for a username and password (You may need to add the --username --password options to ``poetry build``) - for PyPI. +7. Log into your PYPI account and get a token for hpc-beeflow. +8. Finally, on the command line: checkout the main branch and make sure you pull the latest verison + + Then publish by: + ``poetry build`` + + ``poetry publish -u __token__ -p pypi-`` + Check the documentation at: `https://lanl.github.io/BEE/ `_ Also upgrade the pip version in your python or anaconda environment and check the version: diff --git a/ci/docs.sh b/ci/docs.sh new file mode 100755 index 000000000..9fdf28fdd --- /dev/null +++ b/ci/docs.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Install BEE and build the docs in CI. +sudo apt-get update +sudo apt-get install python3 python3-venv curl build-essential \ + zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \ + libreadline-dev libffi-dev libbz2-dev libyaml-dev +curl -sSL https://install.python-poetry.org | python3 - +poetry update +poetry install +poetry run make -C docs/sphinx html diff --git a/pyproject.toml b/pyproject.toml index 784d06a75..41c8ccea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ pylint = "2.15.9" pytest = "7.2.0" pytest-mock = "3.3.1" # This is commented out until we can figure out why it's causing `poetry update` to loop forever -sphinx = "^2.1" +sphinx = "^6" sphinx-rtd-theme = "^1.0" cwltool = "^3.0.20200324120055"