Skip to content

Commit 3eee632

Browse files
committed
Added CI
1 parent 20eb4d1 commit 3eee632

3 files changed

Lines changed: 179 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
build:
15+
name: ${{ matrix.name }}
16+
runs-on: ${{ matrix.runner }}
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- name: Windows x86_64
23+
id: windows-x86_64
24+
runner: windows-2022
25+
generator: Visual Studio 17 2022
26+
platform: x64
27+
osx_architectures: ""
28+
29+
- name: Ubuntu 22.04 x86_64
30+
id: ubuntu-22.04-x86_64
31+
runner: ubuntu-22.04
32+
generator: Ninja
33+
platform: ""
34+
osx_architectures: ""
35+
36+
- name: Ubuntu 22.04 arm64
37+
id: ubuntu-22.04-arm64
38+
runner: ubuntu-22.04-arm
39+
generator: Ninja
40+
platform: ""
41+
osx_architectures: ""
42+
43+
# - name: macOS x86_64
44+
# id: macos-x86_64
45+
# runner: macos-13
46+
# generator: Ninja
47+
# platform: ""
48+
# osx_architectures: ""
49+
50+
# - name: macOS arm64
51+
# id: macos-arm64
52+
# runner: macos-14
53+
# generator: Ninja
54+
# platform: ""
55+
# osx_architectures: ""
56+
57+
- name: macOS universal
58+
id: macos-universal
59+
runner: macos-14
60+
generator: Ninja
61+
platform: ""
62+
osx_architectures: x86_64;arm64
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Install rerun SDK
69+
shell: bash
70+
run: |
71+
python -m pip install --upgrade pip
72+
python -m pip install rerun-sdk==0.33.0
73+
74+
- name: Configure
75+
shell: bash
76+
run: |
77+
cmake_args=(-S . -B build -G "${{ matrix.generator }}")
78+
79+
if [ -n "${{ matrix.platform }}" ]; then
80+
cmake_args+=(-A "${{ matrix.platform }}")
81+
fi
82+
83+
if [ -n "${{ matrix.osx_architectures }}" ]; then
84+
cmake_args+=("-DCMAKE_OSX_ARCHITECTURES=${{ matrix.osx_architectures }}")
85+
fi
86+
87+
if [ "${{ runner.os }}" != "Windows" ]; then
88+
cmake_args+=(-DCMAKE_BUILD_TYPE=Release)
89+
fi
90+
91+
cmake "${cmake_args[@]}"
92+
93+
- name: Build and package
94+
shell: bash
95+
run: cmake --build build --config Release --target package
96+
97+
- name: Upload package artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: package-${{ matrix.id }}
101+
path: build/*.zip
102+
if-no-files-found: error
103+
104+
release:
105+
name: Create release
106+
# if: startsWith(github.ref, 'refs/tags/')
107+
runs-on: ubuntu-22.04
108+
needs: build
109+
110+
steps:
111+
- name: Download packages
112+
uses: actions/download-artifact@v4
113+
with:
114+
pattern: package-*
115+
path: dist
116+
merge-multiple: true
117+
118+
- name: Create or update GitHub release
119+
shell: bash
120+
env:
121+
GH_REPO: ${{ github.repository }}
122+
GH_TOKEN: ${{ github.token }}
123+
run: |
124+
set -euo pipefail
125+
126+
tag_name="ci-${GITHUB_SHA}"
127+
release_title="CI build ${GITHUB_SHA:0:12}"
128+
release_flags=(--prerelease)
129+
130+
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
131+
tag_name="${GITHUB_REF_NAME}"
132+
release_title="${GITHUB_REF_NAME}"
133+
release_flags=()
134+
fi
135+
136+
notes="Automated packages for ${GITHUB_SHA}."
137+
138+
if gh release view "${tag_name}" >/dev/null 2>&1; then
139+
gh release upload "${tag_name}" dist/*.zip --clobber
140+
else
141+
gh release create "${tag_name}" dist/*.zip \
142+
--target "${GITHUB_SHA}" \
143+
--title "${release_title}" \
144+
--notes "${notes}" \
145+
"${release_flags[@]}"
146+
fi

‎CMakeLists.txt‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Creation date: 2025-09-08T16:35:50.334+0200
1212
# NOTICE: MADS Version 1.3.5
1313
cmake_minimum_required(VERSION 3.28)
14-
project(rerun VERSION 1.3.5 LANGUAGES CXX)
14+
project(rerun VERSION 2.1.0 LANGUAGES CXX)
1515
if(CMAKE_BUILD_TYPE STREQUAL "")
1616
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
1717
endif()
@@ -79,7 +79,7 @@ FetchContent_Declare(Eigen
7979

8080
# Download and configure rerun SDK
8181
FetchContent_Declare(rerun_sdk
82-
URL https://github.com/rerun-io/rerun/releases/download/0.31.4/rerun_cpp_sdk.zip
82+
URL https://github.com/rerun-io/rerun/releases/download/0.33.0/rerun_cpp_sdk.zip
8383
EXCLUDE_FROM_ALL
8484
# Arrow (a rerun dependency) is downloaded as a tarball, so "git apply" in
8585
# rerun's own PATCH_COMMAND always fails silently. We replace it with a
@@ -211,3 +211,33 @@ else()
211211
ARCHIVE DESTINATION lib
212212
)
213213
endif()
214+
215+
216+
# PACKAGE #######################################################################
217+
string(TOLOWER "${CMAKE_SYSTEM_NAME}" PACKAGE_OS_NAME)
218+
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
219+
list(LENGTH CMAKE_OSX_ARCHITECTURES PACKAGE_OSX_ARCHITECTURES_COUNT)
220+
if(PACKAGE_OSX_ARCHITECTURES_COUNT GREATER 1)
221+
set(PACKAGE_ARCH_NAME "universal")
222+
else()
223+
set(PACKAGE_ARCH_NAME "${CMAKE_OSX_ARCHITECTURES}")
224+
endif()
225+
else()
226+
set(PACKAGE_ARCH_NAME "${CMAKE_SYSTEM_PROCESSOR}")
227+
endif()
228+
if(PACKAGE_ARCH_NAME STREQUAL "")
229+
set(PACKAGE_ARCH_NAME "${CMAKE_HOST_SYSTEM_PROCESSOR}")
230+
endif()
231+
if(PACKAGE_ARCH_NAME STREQUAL "")
232+
set(PACKAGE_ARCH_NAME "unknown")
233+
endif()
234+
string(TOLOWER "${PACKAGE_ARCH_NAME}" PACKAGE_ARCH_NAME)
235+
236+
set(CPACK_GENERATOR "ZIP")
237+
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
238+
set(CPACK_PACKAGE_VENDOR "MADS")
239+
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
240+
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON)
241+
set(CPACK_PACKAGE_FILE_NAME
242+
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${PACKAGE_OS_NAME}-${PACKAGE_ARCH_NAME}")
243+
include(CPack)

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ We suggest to install it via pip:
5252
```bash
5353
python -m venv .venv
5454
source .venv/bin/activate # On Windows use `.venv\Scripts\activate
55-
pip install rerun-sdk==0.31.4
55+
pip install rerun-sdk==0.33.0
5656
````
5757

5858
Note that the SDK version that you specify in the pip installation must match the version of the Rerun SDK used to build the plugin (see `CMakeLists.txt` in the `FetchContent_Declare(rerun_sdk` section). At the moment, some of the rerun-sdk dependencies (arrow library) for rerun-sdk versions newer than 0.27.3 cannot build on cmake 4.x.

0 commit comments

Comments
 (0)