-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upload rerun_c to ci and show artifacts build results & releases (#…
…3028) * Part of #2919 ### What Adds ci jobs to upload rerun_c for linux x64, mac x64, mac aarch64, windows x64 and shows those both on the build summary html as well as the github developer release Unrelated changes * remove unnecessary dependency from rerun_c - part of #2905 * no longer show full changelog on Dev releases - this got often very long and isn't all that useful, also doesn't understand our minor releases ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3028) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3028) - [Docs preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp%2Frerun_c-ci-build/docs) - [Examples preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp%2Frerun_c-ci-build/examples) --------- Co-authored-by: Jan Procházka <[email protected]>
- Loading branch information
Showing
7 changed files
with
293 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
196 changes: 196 additions & 0 deletions
196
.github/workflows/reusable_build_and_upload_rerun_c.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
name: Reusable Rerun-c Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
CONCURRENCY: | ||
required: true | ||
type: string | ||
PLATFORM: | ||
required: true | ||
type: string | ||
RELEASE_VERSION: | ||
required: false | ||
type: string | ||
default: "prerelease" | ||
UPLOAD_COMMIT_OVERRIDE: | ||
required: false | ||
type: string | ||
default: "" | ||
UPLOAD_COMMIT: | ||
required: false | ||
type: boolean | ||
default: true | ||
ADHOC_NAME: | ||
required: false | ||
type: string | ||
default: "" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
ADHOC_NAME: | ||
required: true | ||
type: string | ||
description: "Name of the adhoc build, used for upload directory" | ||
PLATFORM: | ||
type: choice | ||
options: | ||
- linux | ||
- windows | ||
- macos-arm | ||
- macos-intel | ||
description: "Platform to build for" | ||
required: true | ||
CONCURRENCY: | ||
required: false | ||
type: string | ||
default: "adhoc" | ||
RELEASE_VERSION: | ||
required: false | ||
type: string | ||
default: "prerelease" | ||
UPLOAD_COMMIT_OVERRIDE: | ||
required: false | ||
type: string | ||
default: "" | ||
UPLOAD_COMMIT: | ||
required: false | ||
type: boolean | ||
default: true | ||
|
||
concurrency: | ||
group: ${{ inputs.CONCURRENCY }}-build-rerun_c | ||
cancel-in-progress: true | ||
|
||
env: | ||
# web_sys_unstable_apis is required to enable the web_sys clipboard API which egui_web uses | ||
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html | ||
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html | ||
RUSTFLAGS: --cfg=web_sys_unstable_apis --deny warnings | ||
|
||
# See https://github.com/ericseppanen/cargo-cranky/issues/8 | ||
RUSTDOCFLAGS: --deny warnings --deny rustdoc::missing_crate_level_docs | ||
|
||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
|
||
jobs: | ||
set-config: | ||
name: Set Config (${{ inputs.PLATFORM }}) | ||
runs-on: ubuntu-latest-16-cores | ||
outputs: | ||
RUNNER: ${{ steps.set-config.outputs.runner }} | ||
TARGET: ${{ steps.set-config.outputs.target }} | ||
RUN_TESTS: ${{ steps.set-config.outputs.run_tests }} | ||
CONTAINER: ${{ steps.set-config.outputs.container }} | ||
LIB_NAME: ${{ steps.set-config.outputs.lib_name }} | ||
steps: | ||
- name: Set runner and target based on platform | ||
id: set-config | ||
run: | | ||
case "${{ inputs.PLATFORM }}" in | ||
linux) | ||
runner="ubuntu-latest-16-cores" | ||
target="x86_64-unknown-linux-gnu" | ||
run_tests="true" | ||
container="{'image': 'rerunio/ci_docker:0.8'}" | ||
lib_name="librerun_c.a" | ||
;; | ||
windows) | ||
runner="windows-latest-8-cores" | ||
target="x86_64-pc-windows-msvc" | ||
run_tests="true" | ||
container="null" | ||
lib_name="rerun_c.lib" | ||
;; | ||
macos-arm) | ||
runner="macos-latest" | ||
target="aarch64-apple-darwin" | ||
run_tests="false" | ||
container="null" | ||
lib_name="librerun_c.a" | ||
;; | ||
macos-intel) | ||
runner="macos-latest" | ||
target="x86_64-apple-darwin" | ||
run_tests="false" | ||
container="null" | ||
lib_name="librerun_c.a" | ||
;; | ||
*) echo "Invalid platform" && exit 1 ;; | ||
esac | ||
echo "runner=$runner" >> "$GITHUB_OUTPUT" | ||
echo "target=$target" >> "$GITHUB_OUTPUT" | ||
echo "run_tests=$run_tests" >> "$GITHUB_OUTPUT" | ||
echo "container=$container" >> "$GITHUB_OUTPUT" | ||
echo "lib_name=$lib_name" >> "$GITHUB_OUTPUT" | ||
rs-build-rerun_c: | ||
name: Build rerun_c (${{ needs.set-config.outputs.RUNNER }}) | ||
|
||
needs: [set-config] | ||
|
||
runs-on: ${{ needs.set-config.outputs.RUNNER }} | ||
container: ${{ fromJson(needs.set-config.outputs.CONTAINER) }} | ||
|
||
steps: | ||
- name: Show context | ||
run: | | ||
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT | ||
echo "JOB_CONTEXT": $JOB_CONTEXT | ||
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT | ||
echo "ENV_CONTEXT": $ENV_CONTEXT | ||
env: | ||
ENV_CONTEXT: ${{ toJson(env) }} | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
JOB_CONTEXT: ${{ toJson(job) }} | ||
INPUTS_CONTEXT: ${{ toJson(inputs) }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
cache_key: "build-${{ inputs.PLATFORM }}" | ||
save_cache: false | ||
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
|
||
- name: Build rerun_c (release) | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --locked -p rerun_c --release | ||
|
||
- id: "auth" | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
|
||
- name: Add SHORT_SHA env property with commit short sha | ||
id: "short-sha" | ||
run: | | ||
if [ -z "${{ inputs.UPLOAD_COMMIT_OVERRIDE }}" ]; then | ||
USED_SHA=${{ github.sha }} | ||
else | ||
USED_SHA=${{ inputs.UPLOAD_COMMIT_OVERRIDE }} | ||
fi | ||
echo "SHORT_SHA=$(echo $USED_SHA | cut -c1-7)" >> $GITHUB_OUTPUT | ||
- name: "Upload web-viewer (commit)" | ||
if: ${{ inputs.UPLOAD_COMMIT }} | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: "./target/release/${{ needs.set-config.outputs.LIB_NAME }}" | ||
destination: "rerun-builds/commit/${{ steps.short-sha.outputs.SHORT_SHA }}/rerun_c/${{ inputs.PLATFORM }}" | ||
parent: false | ||
|
||
- name: "Upload web-viewer (adhoc)" | ||
if: ${{ inputs.ADHOC_NAME != '' }} | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: "./target/release/${{ needs.set-config.outputs.LIB_NAME }}" | ||
destination: "rerun-builds/adhoc/${{inputs.ADHOC_NAME}}/rerun_c/${{ inputs.PLATFORM }}" | ||
parent: false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters