Skip to content
85 changes: 74 additions & 11 deletions .github/workflows/conan-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ jobs:
# do have permissions for. See https://github.com/bufbuild/buf/issues/2698 for
# more details.
export BUF_CONFIG_DIR=$(mktemp -d)
conan profile detect
conan create . --build=missing -s:a compiler.cppstd=17 -s:a "&:shared=False"
conan upload "viam-cpp-sdk/*" -r viamconan
conan create . --build=missing -s:a compiler.cppstd=17 -o:a "&:shared=False"
conan upload "viam-cpp-sdk/*" -r viamconan -c

- name: Upload additional deps
if: inputs.upload_deps
run: |
conan upload "boost/*" -r viamconan
conan upload "grpc/*" -r viamconan
conan upload "protobuf/*" -r viamconan
conan upload "boost/*" -r viamconan -c
conan upload "grpc/*" -r viamconan -c
conan upload "protobuf/*" -r viamconan -c


build_linux:
strategy:
fail-fast: false
matrix:
runner: [buildjet-8vcpu-ubuntu-2204, buildjet-8vcpu-ubuntu-2204-arm]
image: [ubuntu:22.04, debian:bookworm]
Expand Down Expand Up @@ -107,6 +107,9 @@ jobs:
sudo \
wget \

c++ --version
ldd --version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(q) curious what this is doing, if anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops leftover debugging to make sure i was getting the arch/os i wanted...joys of github actions yaml 🤡


- name: Install cmake (jammy)
if: matrix.image == 'ubuntu:22.04'
run: |
Expand All @@ -129,6 +132,8 @@ jobs:
python3 -m venv ./conan_venv
. ./conan_venv/bin/activate

pip install conan

conan profile detect
conan remote add viamconan $CONAN_REMOTE_URL
conan remote auth -cc core:non_interactive=True viamconan
Expand All @@ -137,12 +142,70 @@ jobs:
run: |
. ./conan_venv/bin/activate

conan create . --build=missing -s:a compiler.cppstd=17 -s:a "&:shared=False"
conan upload "viam-cpp-sdk/*" -r viamconan
conan create . --build=missing -s:a compiler.cppstd=17 -o:a "&:shared=False"
conan upload "viam-cpp-sdk/*" -r viamconan -c

- name: Upload additional deps
if: inputs.upload_deps && !(matrix.runner == 'buildjet-8vcpu-ubuntu-2204' && matrix.image == 'ubuntu:22.04')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(q) curious about the runner/image constraint here, what's the reason for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the runner/image where we get 100% cache hits from the conan center repo, so there's no need for us to duplicate their binaries in our instance

run: |
conan upload "boost/*" -r viamconan -c
conan upload "grpc/*" -r viamconan -c
conan upload "protobuf/*" -r viamconan -c

build_windows:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: releases/${{ inputs.ref }}

- name: Install dependencies
run: choco install -y conan git

- name: Set up python/conan
shell: powershell
run: |
$ErrorActionPreference = "Stop"
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv

conan profile detect

conan remote add viamconan $env:CONAN_REMOTE_URL
conan remote auth -cc core:non_interactive=True viamconan
env:
CONAN_REMOTE_URL: ${{ secrets.conanRemote }}
CONAN_LOGIN_USERNAME_VIAMCONAN: ${{ secrets.conanUsername}}
CONAN_PASSWORD_VIAMCONAN: ${{ secrets.conanPassword }}
CONAN_USER_HOME: c:/cache
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths

- name: Create and upload package
shell: powershell
run: |
$ErrorActionPreference = "Stop"
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv

conan create . --build=missing -o "&:shared=False" -s:a compiler.cppstd=17
conan upload "viam-cpp-sdk/*" -r viamconan -c
env:
CONAN_USER_HOME: c:/cache
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths

- name: Upload additional deps
if: inputs.upload_deps
shell: powershell
run: |
conan upload "boost/*" -r viamconan
conan upload "grpc/*" -r viamconan
conan upload "protobuf/*" -r viamconan
$ErrorActionPreference = "Stop"
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv

conan upload "boost/*" -r viamconan -c
conan upload "grpc/*" -r viamconan -c
conan upload "protobuf/*" -r viamconan -c
env:
CONAN_USER_HOME: c:/cache
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths