From 7eb36986d54c05bfaa365c8f4a64145484ae6b65 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2026 15:36:33 +0000 Subject: [PATCH 1/5] test: change tiled port number in url --- tests/system_tests/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system_tests/config.yaml b/tests/system_tests/config.yaml index a55417d4cf..c863054a4b 100644 --- a/tests/system_tests/config.yaml +++ b/tests/system_tests/config.yaml @@ -17,7 +17,7 @@ numtracker: url: http://localhost:8406/graphql tiled: enabled: true - url: http://localhost:8407/api/v1 + url: http://localhost:4181/api/v1 authentication: client_id: "tiled-writer" client_secret: "secret" From 8371fdb1a3de8464e343b086c8acc19d9086e731 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Jul 2026 16:34:20 +0000 Subject: [PATCH 2/5] refactor: change github workflow files to use myst-version-switcher-plugin --- .github/workflows/_docs.yml | 54 -------------------------- .github/workflows/_release.yml | 32 --------------- .github/workflows/ci.yml | 33 ++++++++++++---- .github/workflows/publish-dispatch.yml | 36 +++++++++++++++++ docs/conf.py | 2 +- 5 files changed, 62 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/_docs.yml delete mode 100644 .github/workflows/_release.yml create mode 100644 .github/workflows/publish-dispatch.yml diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml deleted file mode 100644 index 0868b55839..0000000000 --- a/.github/workflows/_docs.yml +++ /dev/null @@ -1,54 +0,0 @@ -on: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v7 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Install system packages - run: sudo apt-get install graphviz - - - name: Install uv - uses: astral-sh/setup-uv@v8.3.2 - - - name: Build docs - run: uv run --locked tox -e docs - - - name: Remove environment.pickle - run: rm build/html/.doctrees/environment.pickle - - - name: Upload built docs artifact - uses: actions/upload-artifact@v7 - with: - name: docs - path: build - - - name: Sanitize ref name for docs version - run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV - - - name: Move to versioned directory - run: mv build/html .github/pages/$DOCS_VERSION - - - name: Write switcher.json - run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - - - name: Publish Docs to gh-pages - if: github.ref_type == 'tag' || github.ref_name == 'main' - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: .github/pages - keep_files: true diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml deleted file mode 100644 index 14b4b269a6..0000000000 --- a/.github/workflows/_release.yml +++ /dev/null @@ -1,32 +0,0 @@ -on: - workflow_call: - -jobs: - artifacts: - runs-on: ubuntu-latest - - steps: - - name: Download artifacts - uses: actions/download-artifact@v8 - with: - merge-multiple: true - - - name: Zip up docs - run: | - set -vxeuo pipefail - if [ -d html ]; then - mv html $GITHUB_REF_NAME - zip -r docs.zip $GITHUB_REF_NAME - rm -rf $GITHUB_REF_NAME - fi - - - name: Create GitHub Release - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 - with: - prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }} - files: "*" - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05d03967b2..514b454f7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,10 +40,13 @@ jobs: contents: read packages: write - docs: - uses: ./.github/workflows/_docs.yml - permissions: - contents: write + docs: # Call the docs building workflow directly + uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.24 + with: + # Whatever turns your sources into docs/_build/html at $BASE_URL. uv and Node + # are preinstalled, so: make docs · tox -e docs · npm ci && npm run docs + build-command: uv run --locked tox -e docs + html-dir: build/html dist: uses: ./.github/workflows/_dist.yml @@ -56,8 +59,22 @@ jobs: id-token: write release: - needs: [dist, test, docs] - if: github.ref_type == 'tag' - uses: ./.github/workflows/_release.yml + needs: [docs] + if: github.ref_type == 'tag' # tag pushes only + uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.24 + permissions: + contents: write # create the Release + attach assets + + publish: + needs: [docs] + # don't publish a pages site in the fork's org + if: github.repository == 'DiamondLightSource/blueapi' + uses: ./.github/workflows/publish-dispatch.yml # your workflow (below) + with: + version-name: ${{ needs.docs.outputs.version-name }} permissions: - contents: write + contents: read + actions: write + pages: write + id-token: write + statuses: write diff --git a/.github/workflows/publish-dispatch.yml b/.github/workflows/publish-dispatch.yml new file mode 100644 index 0000000000..4a02e00d05 --- /dev/null +++ b/.github/workflows/publish-dispatch.yml @@ -0,0 +1,36 @@ +# .github/workflows/publish-dispatch.yml +name: Publish (dispatch) +on: + workflow_call: # ci.yml's `publish` job, for every event + inputs: + version-name: {required: false, default: "", type: string} + # tag re-dispatch + fork-PR preview + manual re-deploy + workflow_dispatch: + inputs: + pr: + description: "Fork PR to approve + preview (empty = re-deploy)" + required: false + default: "" + retry-until: + description: "Internal = epoch-second retry deadline. Don't set manually." + required: false + default: "" + +jobs: + publish: + uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/publish.yml@v0.24 + with: + # "" on dispatch → pure durable gather + version-name: ${{ inputs.version-name }} + # set (dispatch) → pin that fork head SHA + pr: ${{ inputs.pr }} + # the file the tag re-dispatch re-fires + dispatch-workflow: publish-dispatch.yml + # forwarded so the re-dispatch job's auto-retry can re-fire this shim + retry-until: ${{ inputs.retry-until }} + permissions: + contents: read + actions: write + pages: write + id-token: write + statuses: write diff --git a/docs/conf.py b/docs/conf.py index 0e96d9dea2..2bc6024482 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -172,7 +172,7 @@ "version_match": version, }, "check_switcher": False, - "navbar_end": ["theme-switcher", "icon-links", "version-switcher"], + "navbar_end": ["theme-switcher", "navbar-icon-links", "version-switcher"], "navigation_with_keys": False, } From fa3cd8e3cfaa7e138692fb3502340bde9f2c98a8 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Jul 2026 16:45:20 +0000 Subject: [PATCH 3/5] revert tiled port number in url --- tests/system_tests/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system_tests/config.yaml b/tests/system_tests/config.yaml index c863054a4b..a55417d4cf 100644 --- a/tests/system_tests/config.yaml +++ b/tests/system_tests/config.yaml @@ -17,7 +17,7 @@ numtracker: url: http://localhost:8406/graphql tiled: enabled: true - url: http://localhost:4181/api/v1 + url: http://localhost:8407/api/v1 authentication: client_id: "tiled-writer" client_secret: "secret" From dce4c89e23dc34fde8a134307bc3cf6e8c0ce4d1 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Thu, 30 Jul 2026 16:07:59 +0100 Subject: [PATCH 4/5] Update .github/workflows/ci.yml Co-authored-by: Tom C (DLS) <101418278+coretl@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 514b454f7d..4cdbf27d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: id-token: write release: - needs: [docs] + needs: [dist, test, docs] if: github.ref_type == 'tag' # tag pushes only uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.24 permissions: From ba1a990eeb15050e4767a99bf124f452359df1bf Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Jul 2026 15:36:26 +0000 Subject: [PATCH 5/5] refactor: change version naming --- docs/conf.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2bc6024482..736cb5987c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,9 +5,8 @@ https://www.sphinx-doc.org/en/master/usage/configuration.html """ +import os import sys -from pathlib import Path -from subprocess import check_output import requests @@ -21,14 +20,7 @@ # The full version, including alpha/beta/rc tags. release = blueapi.__version__ -# The short X.Y version. -if "+" in release: - # Not on a tag, use branch name - root = Path(__file__).absolute().parent.parent - git_branch = check_output("git branch --show-current".split(), cwd=root) - version = git_branch.decode().strip() -else: - version = release +version = os.environ.get("VERSION_NAME", "local") extensions = [ # Use this for generating API docs