name: Build and publish web on: workflow_call: inputs: concurrency: type: string required: true release-version: description: "Release Version Number (Must match Cargo.toml)" type: string required: true release-commit: description: "Commit to release" type: string required: true wheel-artifact-name: description: "Name of the wheel to use when running examples" type: string required: true update-latest: description: "Whether to update the latest version of app" type: boolean required: true defaults: run: shell: bash --noprofile --norc -euo pipefail {0} permissions: contents: "write" id-token: "write" packages: "read" jobs: get-commit-sha: name: Get Commit Sha runs-on: ubuntu-latest outputs: short-sha: ${{ steps.get-short-sha.outputs.short-sha }} full-sha: ${{ steps.get-full-sha.outputs.full-sha }} steps: - name: "Set short-sha" id: get-short-sha run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT - name: "Set full-sha" id: get-full-sha run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT build-web: runs-on: ubuntu-latest-16-cores needs: [get-commit-sha] steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.release-commit }} lfs: true - id: "auth" uses: google-github-actions/auth@v2 with: workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} - name: "Set up Cloud SDK" uses: "google-github-actions/setup-gcloud@v2" with: version: ">= 363.0.0" - name: Set up Rust uses: ./.github/actions/setup-rust with: cache_key: "build-web" save_cache: false workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Bootstrap examples run: | pixi run py-sync-examples # built by `reusable_build_and_publish_wheels` - name: Download Wheel uses: actions/download-artifact@v4 with: name: ${{ inputs.wheel-artifact-name }} path: wheel - name: Install built wheel run: | pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel - name: Print wheel version run: | pixi run uv pip show rerun-sdk pixi run uvpy -m rerun --version - name: Build web-viewer (release) run: | pixi run rerun-build-web-release - name: Build examples run: | pixi run build-examples rrd --install \ --channel "release" \ crates/viewer/re_web_viewer_server/web_viewer/examples - name: Build & run snippets run: | pixi run build-examples snippets \ crates/viewer/re_web_viewer_server/web_viewer/examples/snippets - name: Build examples manifest run: | pixi run build-examples manifest \ --base-url "https://app.rerun.io/version/${{inputs.release-version}}" \ --channel "release" \ crates/viewer/re_web_viewer_server/web_viewer/examples_manifest.json - name: Upload app.rerun.io (versioned) uses: google-github-actions/upload-cloud-storage@v3 with: path: "crates/viewer/re_web_viewer_server/web_viewer" destination: "rerun-web-viewer/version/${{ inputs.release-version }}" parent: false process_gcloudignore: false - name: Upload app.rerun.io (commit) uses: google-github-actions/upload-cloud-storage@v3 with: path: "crates/viewer/re_web_viewer_server/web_viewer" destination: "rerun-web-viewer/commit/${{ needs.get-commit-sha.outputs.short-sha }}" parent: false process_gcloudignore: false # Upload extensionless HTML aliases (signed-in, signed-out) to the # bucket root with the correct Content-Type. The OAuth redirect uses the # origin (app.rerun.io/signed-in), not a versioned path. - name: "Upload HTML aliases to bucket root" run: | cd crates/viewer/re_web_viewer_server/web_viewer for f in *.html; do name="${f%.html}" if [ "$name" != "index" ] && [ "$name" != "index_bundled" ]; then gcloud storage cp --content-type="text/html" "$f" "gs://rerun-web-viewer/${name}" fi done - name: Publish app.rerun.io if: inputs.update-latest run: | gsutil -m cp -r 'gs://rerun-web-viewer/version/${{ inputs.release-version }}/*' gs://rerun-web-viewer/version/latest