-
Notifications
You must be signed in to change notification settings - Fork 385
140 lines (120 loc) · 4.2 KB
/
reusable_publish_web.yml
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
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
permissions:
contents: "write"
id-token: "write"
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 }}
- 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/[email protected]
with:
pixi-version: v0.39.0
environments: wheel-test
# 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/pixi_install_wheel.py --feature python-pypi --package rerun-sdk --dir wheel
- name: Print wheel version
run: |
pixi list -e wheel-test | grep rerun_sdk
pixi run -e wheel-test python -m rerun --version
pixi run -e wheel-test which rerun
- name: Build web-viewer (release)
run: |
pixi run -e wheel-test rerun-build-web-release
- name: Build examples
run: |
pixi run -e wheel-test build-examples rrd \
--channel "release" \
web_viewer/examples
- name: Build & run snippets
run: |
pixi run -e wheel-test build-examples snippets \
web_viewer/examples/snippets
- name: Build examples manifest
run: |
pixi run -e wheel-test build-examples manifest \
--base-url "https://app.rerun.io/version/${{inputs.release-version}}" \
--channel "release" \
web_viewer/examples_manifest.json
- name: Upload app.rerun.io (versioned)
uses: google-github-actions/upload-cloud-storage@v2
with:
path: "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@v2
with:
path: "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