Skip to content

feat: extend cookie prompt to Sphinx docs as well #63

feat: extend cookie prompt to Sphinx docs as well

feat: extend cookie prompt to Sphinx docs as well #63

Workflow file for this run

name: Pre Release library
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!main' # excludes main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'npm'
# Path to the lock file needs to be specified explicitly as it is not in the root of the repository
cache-dependency-path: 'documentation-ui/package-lock.json'
- name: Lint documentation UI JS package
working-directory: documentation-ui
run: |
npm ci
npm run lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'npm'
# Path to the lock file needs to be specified explicitly as it is not in the root of the repository
cache-dependency-path: 'documentation-ui/package-lock.json'
- name: Build documentation UI JS package
working-directory: documentation-ui
run: |
npm ci
npm run build
build_sphinx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: 'poetry'
cache-dependency-path: 'sphinx-ui/pyproject.toml'
- name: Set up Node.js for UI Assets
uses: actions/setup-node@v6
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'sphinx-ui/react/package-lock.json'
- name: Build documentation UI JS package
working-directory: documentation-ui
run: |
npm ci
npm run build
- name: Generate UI Assets
working-directory: sphinx-ui/react
run: |
echo "🔨 Generating UI assets..."
npm install
npm run build
cp ./build/injectNav.iife.js ../quantinuum_sphinx/static/injectNav.iife.js
cp ./build/syncTheme.iife.js ../quantinuum_sphinx/static/syncTheme.iife.js
cp ./node_modules/@quantinuum/documentation-ui/dist/tokens.css ../quantinuum_sphinx/static/styles/quantinuum-ui-tokens.css
npx tailwindcss --postcss ./postcss.config.cjs -i ./index.css -o ../quantinuum_sphinx/static/styles/quantinuum-ui-tailwind.css
echo ✅ "Done. Generated UI assets."
- name: Build
working-directory: sphinx-ui
run: |
echo "📦 Building..."
poetry config http-basic.pypi_local ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_API_TOKEN }}
poetry build
echo ✅ "Done."