|
| 1 | +name: Publish conan packages |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + ref: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + description: Version number (eg v0.20.1) |
| 10 | + upload_deps: |
| 11 | + required: true |
| 12 | + type: boolean |
| 13 | + default: false |
| 14 | + description: If true, publish slow-building deps as well |
| 15 | + |
| 16 | +jobs: |
| 17 | + build_macos: |
| 18 | + # Not sure if we actually need x64 macos-latest |
| 19 | + runs-on: macos-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + ref: releases/${{ inputs.ref }} |
| 26 | + |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + cmake --version |
| 31 | + python --version |
| 32 | + ninja --version |
| 33 | + brew install buf |
| 34 | + python -m pip install conan |
| 35 | +
|
| 36 | + - name: Set up python/conan |
| 37 | + env: |
| 38 | + CONAN_REMOTE_URL: ${{ secrets.conanRemote }} |
| 39 | + CONAN_LOGIN_USERNAME_VIAMCONAN: ${{ secrets.conanUsername}} |
| 40 | + CONAN_PASSWORD_VIAMCONAN: ${{ secrets.conanPassword }} |
| 41 | + run: | |
| 42 | + conan profile detect |
| 43 | + conan remote add viamconan $CONAN_REMOTE_URL |
| 44 | + conan remote auth -cc core:non_interactive=True viamconan |
| 45 | +
|
| 46 | + - name: Create and upload package |
| 47 | + run: | |
| 48 | + # `buf` tries to read a CLI config file that we don't actually use located at |
| 49 | + # ~/.config/buf/config.yaml. We don't always have permission to access this |
| 50 | + # directory in CI, so we set the `BUF_CONFIG_DIR` to some other value that we |
| 51 | + # do have permissions for. See https://github.com/bufbuild/buf/issues/2698 for |
| 52 | + # more details. |
| 53 | + export BUF_CONFIG_DIR=$(mktemp -d) |
| 54 | + conan profile detect |
| 55 | + conan create . --build=missing -s:a compiler.cppstd=17 -s:a "&:shared=False" |
| 56 | + conan upload "viam-cpp-sdk/*" -r viamconan |
| 57 | +
|
| 58 | + - name: Upload additional deps |
| 59 | + if: inputs.upload_deps |
| 60 | + run: | |
| 61 | + conan upload "boost/*" -r viamconan |
| 62 | + conan upload "grpc/*" -r viamconan |
| 63 | + conan upload "protobuf/*" -r viamconan |
| 64 | +
|
| 65 | +
|
| 66 | + build_linux: |
| 67 | + strategy: |
| 68 | + matrix: |
| 69 | + runner: [buildjet-8vcpu-ubuntu-2204, buildjet-8vcpu-ubuntu-2204-arm] |
| 70 | + image: [ubuntu:22.04, debian:bookworm] |
| 71 | + runs-on: ${{ matrix.runner }} |
| 72 | + container: |
| 73 | + image: ${{ matrix.image }} |
| 74 | + |
| 75 | + steps: |
| 76 | + - name: Checkout code |
| 77 | + uses: actions/checkout@v4 |
| 78 | + with: |
| 79 | + ref: releases/${{ inputs.ref }} |
| 80 | + |
| 81 | + - name: Show platform info |
| 82 | + run: | |
| 83 | + uname -a |
| 84 | + cat /etc/os-release |
| 85 | +
|
| 86 | + - name: Install common deps |
| 87 | + run: | |
| 88 | + apt-get update |
| 89 | + apt-get -y dist-upgrade |
| 90 | + DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ |
| 91 | + autoconf \ |
| 92 | + automake \ |
| 93 | + build-essential \ |
| 94 | + ca-certificates \ |
| 95 | + curl \ |
| 96 | + doxygen \ |
| 97 | + g++ \ |
| 98 | + gdb \ |
| 99 | + gnupg \ |
| 100 | + gpg \ |
| 101 | + less \ |
| 102 | + ninja-build \ |
| 103 | + python3 \ |
| 104 | + python3-pip \ |
| 105 | + python3-venv \ |
| 106 | + software-properties-common \ |
| 107 | + sudo \ |
| 108 | + wget \ |
| 109 | +
|
| 110 | + - name: Install cmake (jammy) |
| 111 | + if: matrix.image == 'ubuntu:22.04' |
| 112 | + run: | |
| 113 | + sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null |
| 114 | + sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null |
| 115 | +
|
| 116 | + apt-get update |
| 117 | + apt-get -y install cmake=3.25.2-0kitware1ubuntu22.04.1 cmake-data=3.25.2-0kitware1ubuntu22.04.1 |
| 118 | +
|
| 119 | + - name: Install cmake (bookworm) |
| 120 | + if: matrix.image == 'debian:bookworm' |
| 121 | + run: DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install cmake |
| 122 | + |
| 123 | + - name: Set up python/conan |
| 124 | + env: |
| 125 | + CONAN_REMOTE_URL: ${{ secrets.conanRemote }} |
| 126 | + CONAN_LOGIN_USERNAME_VIAMCONAN: ${{ secrets.conanUsername}} |
| 127 | + CONAN_PASSWORD_VIAMCONAN: ${{ secrets.conanPassword }} |
| 128 | + run: | |
| 129 | + python3 -m venv ./conan_venv |
| 130 | + . ./conan_venv/bin/activate |
| 131 | +
|
| 132 | + conan profile detect |
| 133 | + conan remote add viamconan $CONAN_REMOTE_URL |
| 134 | + conan remote auth -cc core:non_interactive=True viamconan |
| 135 | +
|
| 136 | + - name: Create and upload package |
| 137 | + run: | |
| 138 | + . ./conan_venv/bin/activate |
| 139 | +
|
| 140 | + conan create . --build=missing -s:a compiler.cppstd=17 -s:a "&:shared=False" |
| 141 | + conan upload "viam-cpp-sdk/*" -r viamconan |
| 142 | +
|
| 143 | + - name: Upload additional deps |
| 144 | + if: inputs.upload_deps |
| 145 | + run: | |
| 146 | + conan upload "boost/*" -r viamconan |
| 147 | + conan upload "grpc/*" -r viamconan |
| 148 | + conan upload "protobuf/*" -r viamconan |
0 commit comments