forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 1
154 lines (132 loc) · 4.67 KB
/
reusable_publish_web.yml
File metadata and controls
154 lines (132 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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.9.1
with:
pixi-version: v0.55.0
- 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: "Create HTML aliases without extensions"
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
cp "$f" "$name"
fi
done
- 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
- 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