Skip to content

Fix topics like level1/level2 #14

Fix topics like level1/level2

Fix topics like level1/level2 #14

Workflow file for this run

name: Build and Release
on:
push:
branches:
- main
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows x86_64
id: windows-x86_64
runner: windows-2022
generator: Visual Studio 17 2022
platform: x64
osx_architectures: ""
- name: Ubuntu 22.04 x86_64
id: ubuntu-22.04-x86_64
runner: ubuntu-22.04
generator: Ninja
platform: ""
osx_architectures: ""
- name: Ubuntu 22.04 arm64
id: ubuntu-22.04-arm64
runner: ubuntu-22.04-arm
generator: Ninja
platform: ""
osx_architectures: ""
# - name: macOS x86_64
# id: macos-x86_64
# runner: macos-13
# generator: Ninja
# platform: ""
# osx_architectures: ""
# - name: macOS arm64
# id: macos-arm64
# runner: macos-14
# generator: Ninja
# platform: ""
# osx_architectures: ""
- name: macOS arm64
id: macos-arm64
runner: macos-14
generator: Ninja
platform: ""
osx_architectures: ""
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install rerun SDK
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install rerun-sdk==0.33.0
- name: Configure
shell: bash
run: |
cmake_args=(-S . -B build -G "${{ matrix.generator }}")
if [ -n "${{ matrix.platform }}" ]; then
cmake_args+=(-A "${{ matrix.platform }}")
fi
if [ -n "${{ matrix.osx_architectures }}" ]; then
cmake_args+=("-DCMAKE_OSX_ARCHITECTURES=${{ matrix.osx_architectures }}")
fi
if [ "${{ runner.os }}" != "Windows" ]; then
cmake_args+=(-DCMAKE_BUILD_TYPE=Release)
fi
cmake "${cmake_args[@]}"
- name: Build and package
shell: bash
run: cmake --build build --config Release --target package
- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: package-${{ matrix.id }}
path: build/*.zip
if-no-files-found: error
release:
name: Create release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
pattern: package-*
path: dist
merge-multiple: true
- name: Create or update GitHub release
shell: bash
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
tag_name="ci-${GITHUB_SHA}"
release_title="CI build ${GITHUB_SHA:0:12}"
release_flags=(--prerelease)
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
tag_name="${GITHUB_REF_NAME}"
release_title="${GITHUB_REF_NAME}"
release_flags=()
fi
notes="Automated packages for ${GITHUB_SHA}."
if gh release view "${tag_name}" >/dev/null 2>&1; then
gh release upload "${tag_name}" dist/*.zip --clobber
else
gh release create "${tag_name}" dist/*.zip \
--target "${GITHUB_SHA}" \
--title "${release_title}" \
--notes "${notes}" \
"${release_flags[@]}"
fi