Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:MarketSquare Robotframework browser Github Release Workflow

From Leeroopedia

Document Type

External Tool Doc -- Documents the GitHub Actions workflow file .github/workflows/on-release.yml that automates the multi-platform build, test, and publish pipeline triggered when a GitHub release is published.

Tool Summary

This GitHub Actions workflow orchestrates the complete release pipeline for the robotframework-browser project. It builds distribution packages on 5 platform/architecture combinations, smoke-tests them, publishes to PyPI, builds and pushes multi-architecture Docker images to Docker Hub and GHCR, and deploys keyword documentation to GitHub Pages.

Source Reference

File Lines Description
.github/workflows/on-release.yml L1-366 Complete release workflow definition

Trigger

name: Release tasks

on:
  release:
    types: [ published ]

The workflow runs when a GitHub release is published. This is typically done by a maintainer after completing the release preparation steps (version bump, docs, release notes).

Job 1: gh-pages

Purpose: Deploy keyword documentation to GitHub Pages.

Runner: ubuntu-latest

gh-pages:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v6
    - uses: actions/setup-node@v6
      with:
        node-version: 22.x
    - uses: actions/setup-python@v6
      with:
        python-version: 3.12
    - name: Dependencies for building docs
      run: |
        npm ci
        python -m pip install --upgrade pip
        pip install uv
        uv pip install -r Browser/dev-requirements.txt  --python 3.12 --system
        uv pip install -r pyproject.toml  --python 3.12 --system
        inv build
    - name: Build docs
      run: |
        inv docs
        inv gh-pages-index
    - name: Deploy
      uses: JamesIves/github-pages-deploy-action@v4.8.0
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        BRANCH: gh-pages
        FOLDER: docs

Key details:

  • Installs all dependencies and builds the project
  • Generates keyword docs (inv docs) and index page (inv gh-pages-index)
  • Deploys the docs/ folder to the gh-pages branch

Job 2: build_browser_wheels

Purpose: Build distribution packages on all supported platforms.

Runner: Matrix of 5 platforms

build_browser_wheels:
  name: Build wheels on ${{ matrix.os }}
  runs-on: ${{ matrix.os }}
  strategy:
    fail-fast: false
    matrix:
      include:
        - os: ubuntu-latest
        - os: ubuntu-24.04-arm
        - os: windows-latest
        - os: macos-15-intel
        - os: macos-latest
          arch: arm64

Steps performed on each platform:

  1. Set up Node.js 22.x and Python 3.13
  2. Install dependencies with inv deps
  3. Build stubs (Ubuntu only): inv node-build
  4. Create Browser wheel (Ubuntu only): inv create-package
  5. Build test app: inv create-test-app
  6. Package demo app: inv demo-app
  7. Build BrowserBatteries wheel: inv package-nodejs

Artifacts uploaded:

Artifact Name Content Platform
rfbrowser-wheel robotframework_browser-*-py3-none-any.whl Ubuntu only (universal)
browser-batteries-wheels-{os} robotframework_browser_batteries-*.whl Each platform
demoapp-{os} Zipped demo application Each platform

Job 3: test_browser_wheels

Purpose: Validate built packages with smoke tests on clean installations.

Depends on: build_browser_wheels

Runner: Same 5-platform matrix

Key steps:

  1. Download the universal Browser wheel and platform-specific BrowserBatteries wheel
  2. Download the platform-specific demo app
  3. Install both wheels with pip
  4. Run rfbrowser install --with-deps to install Playwright browsers
  5. Remove source directories (Browser/, node/, browser_batteries/) to ensure tests use installed packages
  6. Unzip demo app
  7. Run acceptance tests:
    • Ubuntu: xvfb-run --auto-servernum invoke atest-robot --smoke
    • Windows/macOS: inv atest-robot

Uses Python 3.14 for testing to validate forward compatibility.

Job 4: publish-browser-to-pypi

Purpose: Publish the Browser library wheel to PyPI.

Depends on: build_browser_wheels, test_browser_wheels

publish-browser-to-pypi:
  needs:
    - build_browser_wheels
    - test_browser_wheels
  runs-on: ubuntu-latest
  environment:
    name: pypi
    url: https://pypi.org/p/robotframework-browser
  permissions:
    id-token: write
  steps:
    - name: Check
      run: |
        twine check dist/*
    - name: Publish Browser distribution to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1

Key details:

Job 5: publish-browserbatteries-to-pypi

Purpose: Publish all platform-specific BrowserBatteries wheels to PyPI.

Depends on: build_browser_wheels, test_browser_wheels

publish-browserbatteries-to-pypi:
  needs:
    - build_browser_wheels
    - test_browser_wheels
  runs-on: ubuntu-latest
  environment:
    name: pypi
    url: https://pypi.org/p/robotframework-browser-batteries
  permissions:
    id-token: write
  steps:
    - name: Download rfbrowser-browser-wheels
      uses: actions/download-artifact@v7
      with:
        pattern: browser-batteries-wheels-*
        path: dist
        merge-multiple: true
    - name: Publish BrowserBatteries distribution to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1

Key details:

  • Downloads all BrowserBatteries wheels from all platforms using the merge-multiple: true option
  • All platform-specific wheels are published in a single upload

Job 6: docker-image

Purpose: Build and push multi-architecture Docker images.

Depends on: publish-browser-to-pypi

docker-image:
  needs: publish-browser-to-pypi
  runs-on: ubuntu-latest
  steps:
    - uses: docker/setup-qemu-action@v3
    - uses: docker/setup-buildx-action@v3
    - name: Login to Docker Hub
      uses: docker/login-action@v3
    - name: Push tag to Docker Hub
      uses: docker/build-push-action@v6
      with:
        file: docker/Dockerfile.latest_release
        platforms: linux/arm64/v8,linux/amd64
        push: true
    - name: Login to GitHub Container Registry
      uses: docker/login-action@v3
      with:
        registry: ghcr.io
    - name: Push to GitHub Packages
      uses: docker/build-push-action@v6
      with:
        platforms: linux/arm64/v8,linux/amd64
        file: docker/Dockerfile.latest_release
        push: true

Docker Hub image: marketsquare/robotframework-browser

GHCR image: ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable

Tags applied (via docker/metadata-action):

Tag Pattern Example
Semantic version (full) 19.13.0
Semantic version (major.minor) 19.13
Semantic version (major) 19
Latest latest

Architectures: linux/arm64/v8 and linux/amd64 (built via QEMU cross-compilation)

Job 7: test-docker-image

Purpose: Validate the published Docker image with acceptance tests.

Depends on: docker-image

test-docker-image:
  needs: docker-image
  runs-on: ubuntu-latest
  steps:
    - name: Install dependencies
      run: |
        invoke deps
    - name: Build testing docker image
      run: |
        invoke docker-tester
    - name: Run tests with latest stable docker image
      run: |
        invoke docker-test

Key details:

  • Installs project dependencies
  • Builds a test Docker image (docker/Dockerfile.tests)
  • Runs acceptance tests inside the container using xvfb-run

Complete Job Dependency Graph

[gh-pages]                              (runs independently)

[build_browser_wheels]                  (runs independently)
         |
         v
[test_browser_wheels]                   (needs: build)
         |
    +----+----+
    |         |
    v         v
[publish-    [publish-
 browser-     browserbatteries-
 to-pypi]     to-pypi]
    |
    v
[docker-image]
    |
    v
[test-docker-image]

Secrets Required

Secret Used By Purpose
GITHUB_TOKEN gh-pages, GHCR login Automatic GitHub token
DOCKER_USERNAME docker-image Docker Hub authentication
DOCKER_TOKEN docker-image Docker Hub authentication
PyPI OIDC publish jobs Trusted publisher (no secret needed)

Related

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment