Skip to content

Commit 08b85ee

Browse files
authored
Upload manylinux builds of tket and tket-c-api to artifactory (#2102)
1 parent c153846 commit 08b85ee

File tree

5 files changed

+72
-5
lines changed

5 files changed

+72
-5
lines changed

.github/workflows/build_and_test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,34 @@ jobs:
246246
ccache -s #show stats
247247
ccache -z #show stats
248248
249+
build_tket_c_api_manylinux:
250+
name: Build tket-c-api and upload to artifactory
251+
strategy:
252+
matrix:
253+
include:
254+
- os: 'ubuntu-24.04'
255+
container: 'manylinux_2_28_x86_64'
256+
profile: 'linux-x86_64-gcc14'
257+
- os: 'ubuntu-24.04-arm'
258+
container: 'manylinux_2_28_aarch64'
259+
profile: 'linux-armv8-gcc14'
260+
needs: check_changes
261+
if: (needs.check_changes.outputs.tket_or_c_api_changed == 'true') && (github.event_name == 'push')
262+
runs-on: ${{ matrix.os }}
263+
steps:
264+
- uses: actions/checkout@v6
265+
with:
266+
fetch-depth: '0'
267+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
268+
- name: Set up container
269+
run: docker create --name linux_build -i -v /:/host quay.io/pypa/${{ matrix.container }}:latest /bin/bash
270+
- name: Copy source
271+
run: docker cp . linux_build:/tket/
272+
- name: Start container
273+
run: docker start linux_build
274+
- name: Build and upload tket-c-api
275+
run: docker exec -e CONAN_PROFILE=${{ matrix.profile }} -e TKET_VERSION=`cat TKET_VERSION` linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildcapi"
276+
249277
build_test_pytket_ubuntu:
250278
name: Build and test pytket (ubuntu)
251279
needs: check_changes

.github/workflows/linuxbuildcapi

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Copyright Quantinuum
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -evu
18+
19+
cd /tket
20+
21+
export PYBIN=/opt/python/cp312-cp312/bin
22+
export PYEX=${PYBIN}/python
23+
${PYEX} -m venv env
24+
${PYEX} -m pip install conan
25+
CONAN_CMD=${PYBIN}/conan
26+
${CONAN_CMD} profile detect
27+
DEFAULT_PROFILE_PATH=`${CONAN_CMD} profile path default`
28+
PROFILE_PATH=./conan-profiles/${CONAN_PROFILE}
29+
diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
30+
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
31+
${CONAN_CMD} remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
32+
33+
# Build tket and tket-c-api
34+
${CONAN_CMD} create tket --user=tket --channel=stable -o boost/*:header_only=True
35+
${CONAN_CMD} create tket-c-api -s build_type=Release --user=tket --channel=stable -o boost/*:header_only=True
36+
37+
# Upload to artifactory
38+
${CONAN_CMD} upload tket/${TKET_VERSION}@tket/stable -r=tket-libs
39+
${CONAN_CMD} upload tket-c-api/${TKET_VERSION}@tket/stable -r=tket-libs

TKET_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.67
1+
2.1.68

tket-c-api/test_package/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.15)
22
project(PackageTest CXX)
33

44
find_package(tket-c-api CONFIG REQUIRED)
5-
6-
5+
find_package(Threads)
76

87
add_executable(example src/example.cpp)
9-
target_link_libraries(example tket-c-api::tket-c-api)
8+
target_link_libraries(example tket-c-api::tket-c-api ${CMAKE_THREAD_LIBS_INIT})

tket/test_package/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cmake_minimum_required(VERSION 3.23)
1616
project(PackageTest CXX)
1717

1818
find_package(tket CONFIG REQUIRED)
19+
find_package(Threads)
1920

2021
set (CMAKE_CXX_STANDARD 20)
2122
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -25,4 +26,4 @@ IF (WIN32)
2526
ENDIF()
2627

2728
add_executable(test src/test.cpp)
28-
target_link_libraries(test tket::tket)
29+
target_link_libraries(test tket::tket ${CMAKE_THREAD_LIBS_INIT})

0 commit comments

Comments
 (0)