Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/conda-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: conda-release

# Build + publish the SDK conda package to the prefix.dev "plotjuggler" channel
# on tag push. Requires repo secret PREFIX_API_KEY = a prefix.dev token with
# write access to the "plotjuggler" channel.
on:
push:
tags:
- "v*"
# Manual dispatch builds the current conanfile.py/recipe.yaml version (no tag
# guard); idempotent via `rattler-build upload --skip-existing`.
workflow_dispatch: {}

permissions:
contents: read

jobs:
build-and-upload:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04] # extend to macos-15-intel, windows-2022 in a later task
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify tag matches all version sources
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
tag="${GITHUB_REF_NAME#v}"
# The SDK version is hardcoded in three places that must agree with the tag:
# conanfile.py version = "..." (Conan package + the tag guard)
# recipe.yaml context.version "..." (embedded in the published .conda)
# CMakeLists.txt PJ_PACKAGE_VERSION "..." (baked into ConfigVersion.cmake,
# matched by find_package(... <ver>))
conan_ver="$(grep -E '^\s*version\s*=' conanfile.py | head -1 | sed -E 's/.*"(.*)".*/\1/')"
recipe_ver="$(grep -E '^[[:space:]]+version:[[:space:]]*"' recipe.yaml | head -1 | sed -E 's/.*"(.*)".*/\1/')"
cmake_ver="$(grep -E 'set\(PJ_PACKAGE_VERSION' CMakeLists.txt | head -1 | sed -E 's/.*"(.*)".*/\1/')"
echo "tag=$tag conanfile.py=$conan_ver recipe.yaml=$recipe_ver CMakeLists.txt=$cmake_ver"
fail=0
for pair in "conanfile.py:$conan_ver" "recipe.yaml:$recipe_ver" "CMakeLists.txt:$cmake_ver"; do
if [ "$tag" != "${pair#*:}" ]; then
echo "::error::Tag v$tag does not match ${pair%%:*} version (${pair#*:})"
fail=1
fi
done
[ "$fail" -eq 0 ]

- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.38
with:
setup-only: true
rattler-build-version: v0.66.2

- name: Build conda package
shell: bash
run: |
rattler-build build \
--recipe recipe.yaml \
--channel conda-forge \
--output-dir "${{ runner.temp }}/conda-output"

- name: Upload to prefix.dev (plotjuggler)
shell: bash
env:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
run: |
find "${{ runner.temp }}/conda-output" -name '*.conda' -print0 \
| xargs -0 rattler-build upload prefix --channel plotjuggler --skip-existing
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ pj_media/testdata/
/.vscode/*
/CMakeUserPresets.json
/aqtinstall.log
/.pixi/
/output/
/build-test/
Loading
Loading