Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .github/workflows/_docs.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/_release.yml

This file was deleted.

31 changes: 24 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,7 +60,21 @@ jobs:

release:
needs: [dist, test, docs]
if: github.ref_type == 'tag'
uses: ./.github/workflows/_release.yml
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only 3 versions post 1.0.0 which are not deployed because they don't have their docs.zip file in the release assets.

List of versions not deployed

0.0.1-pre
0.0.1-pre1
0.0.1-pre2
0.0.1-pre3
0.0.1-pre4
0.0.1-pre5
0.0.1-pre6
0.0.2
0.0.3
0.0.4
0.1.0
0.2.0
0.2.1
0.2.2
0.2.3
0.2.3b1
0.3.0
0.3.1
0.3.10
0.3.11
0.3.12
0.3.13
0.3.14
0.3.15
0.3.15-a0
0.3.15-alpha0
0.3.15-alpha1
0.3.15-dev0
0.3.15a0
0.3.2
0.3.3
0.3.4
0.3.5
0.3.5-alpha
0.3.5-beta
0.3.5-beta10
0.3.5-beta11
0.3.5-beta12
0.3.5-beta2
0.3.5-beta3
0.3.5-beta4
0.3.5-beta5
0.3.5-beta6
0.3.5-beta7
0.3.5-beta8
0.3.5-beta9
0.3.6
0.3.7
0.3.8
0.3.9
0.4.0
0.4.5-a2
0.4.5-a4
0.4.5-a5
1.2.1
1.6.1
1.7.2

I think it will not be a problem in the future because publish needs docs.

It could have a verification at the end to check if the current release page is deployed so we don't fail silently.

with:
version-name: ${{ needs.docs.outputs.version-name }}
permissions:
contents: write
contents: read
actions: write
pages: write
id-token: write
statuses: write
36 changes: 36 additions & 0 deletions .github/workflows/publish-dispatch.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 3 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -172,7 +164,7 @@
"version_match": version,
},
"check_switcher": False,
"navbar_end": ["theme-switcher", "icon-links", "version-switcher"],
"navbar_end": ["theme-switcher", "navbar-icon-links", "version-switcher"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line change was a surprise, why is it needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what was in the code here

"navigation_with_keys": False,
}

Expand Down
Loading