Skip to content

Commit 90fdbfd

Browse files
authored
added configure conan (#20)
1 parent 88c30a9 commit 90fdbfd

File tree

5 files changed

+79
-69
lines changed

5 files changed

+79
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'get conan dependency provider'
2+
description: "installs conan_provider.cmake"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Get dependency provider
7+
shell: bash
8+
run: |
9+
sudo apt-get install -y wget
10+
11+
wget https://github.com/conan-io/cmake-conan/raw/develop2/conan_provider.cmake -O conan_provider.cmake
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Configure Conan'
2+
description: "installs conan via pip and creates a default user for it"
3+
inputs:
4+
conan-version:
5+
description: "conan version to install"
6+
default: 2.3.1
7+
required: true
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Install conan
12+
shell: bash
13+
run: |
14+
pip3 install "conan==${{ inputs.conan-version }}"
15+
16+
- name: configure conan
17+
shell: bash
18+
run: |
19+
# conan profile update is deprecated (https://github.com/conan-io/conan/issues/13205)
20+
# and they don't want you to use detect because it is unstable
21+
22+
conan profile detect # Force creation of conan directory structure, will be overwritten
23+
24+
echo '{% set compiler, version = detect_api.detect_compiler() %}' > ~/.conan2/profiles/default
25+
echo '[settings]' >> ~/.conan2/profiles/default
26+
echo 'os={{ detect_api.detect_os() }}' >> ~/.conan2/profiles/default
27+
echo 'arch={{ detect_api.detect_arch() }}' >> ~/.conan2/profiles/default
28+
echo 'build_type=Release' >> ~/.conan2/profiles/default
29+
echo 'compiler={{ compiler }}' >> ~/.conan2/profiles/default
30+
echo 'compiler.version={{ detect_api.default_compiler_version(compiler, version) }}' >> ~/.conan2/profiles/default
31+
echo 'compiler.libcxx=libstdc++11' >> ~/.conan2/profiles/default

.github/actions/setup_apt/action.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'setup apt repositories'
2+
description: "sets up package apt repositories for clang/gcc"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Add repos
7+
shell: bash
8+
run: |
9+
# gcc-13
10+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
11+
12+
# clang-16
13+
source /etc/os-release
14+
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
15+
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-16.gpg > /dev/null
16+
17+
# clang-17
18+
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-17 main" | sudo tee /etc/apt/sources.list.d/llvm-17.list
19+
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-17.gpg > /dev/null
20+
21+
sudo apt-get update -y

.github/workflows/publish-conan-branch-package.yml

+8-35
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ on:
1515
default: clang-17
1616
cmake-version:
1717
type: string
18-
default: 3.21.7
18+
default: 3.24.0
1919
conan-version:
2020
type: string
21-
default: 2.0.13
21+
default: 2.3.0
2222
conan-options:
2323
type: string
2424
secrets:
@@ -39,19 +39,7 @@ jobs:
3939
sudo apt-get install -y jq python3 python3-pip
4040
4141
- name: Add repos for for gcc-13 and clang-16,17
42-
run: |
43-
# gcc-13
44-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
45-
46-
# clang-16
47-
source /etc/os-release
48-
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
49-
50-
# clang-17
51-
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-17 main" | sudo tee /etc/apt/sources.list.d/llvm-17.list
52-
53-
# llvm key
54-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm.gpg > /dev/null
42+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/setup_apt
5543

5644
- name: Ensure stdlib version
5745
run: |
@@ -72,27 +60,12 @@ jobs:
7260
uses: rui314/setup-mold@v1
7361

7462
- name: Install conan
75-
shell: bash
76-
env:
77-
CC: ${{ steps.install_cc.outputs.cc }}
78-
CXX: ${{ steps.install_cc.outputs.cxx }}
63+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/configure_conan
64+
with:
65+
conan-version: ${{ inputs.conan-version }}
66+
67+
- name: add conan user
7968
run: |
80-
pip3 install "conan==${{ inputs.conan-version }}"
81-
82-
# conan profile update is deprecated (https://github.com/conan-io/conan/issues/13205)
83-
# and they don't want you to use detect because it is unstable
84-
85-
conan profile detect # Force creation of conan directory structure, will be overwritten
86-
87-
echo '{% set compiler, version = detect_api.detect_compiler() %}' > ~/.conan2/profiles/default
88-
echo '[settings]' >> ~/.conan2/profiles/default
89-
echo 'os={{ detect_api.detect_os() }}' >> ~/.conan2/profiles/default
90-
echo 'arch={{ detect_api.detect_arch() }}' >> ~/.conan2/profiles/default
91-
echo 'build_type=Release' >> ~/.conan2/profiles/default
92-
echo 'compiler={{ compiler }}' >> ~/.conan2/profiles/default
93-
echo 'compiler.version={{ detect_api.default_compiler_version(compiler, version) }}' >> ~/.conan2/profiles/default
94-
echo 'compiler.libcxx=libstdc++11' >> ~/.conan2/profiles/default
95-
9669
conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
9770
conan remote login -p "${{ secrets.CONAN_PW }}" dice-group "${{ secrets.CONAN_USER }}"
9871

.github/workflows/publish-release.yml

+8-34
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ on:
1515
default: clang-17
1616
cmake-version:
1717
type: string
18-
default: 3.21.7
18+
default: 3.24.0
1919
conan-version:
2020
type: string
21-
default: 1.60.1
21+
default: 2.3.0
2222
conan-options:
2323
type: string
2424
use-tag: # if true an existing tag/release is update; otherwise the job fails. If true the job will also fail if the tag doesn't match the version reported via conan.
@@ -49,19 +49,7 @@ jobs:
4949
sudo apt-get install -y jq python3 python3-pip
5050
5151
- name: Add repos for for gcc-13 and clang-16,17
52-
run: |
53-
# gcc-13
54-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
55-
56-
# clang-16
57-
source /etc/os-release
58-
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
59-
60-
# clang-17
61-
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-17 main" | sudo tee /etc/apt/sources.list.d/llvm-17.list
62-
63-
# llvm key
64-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm.gpg > /dev/null
52+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/setup_apt
6553

6654
- name: Ensure stdlib version
6755
run: |
@@ -82,26 +70,12 @@ jobs:
8270
uses: rui314/setup-mold@v1
8371

8472
- name: Install conan
85-
env:
86-
CC: ${{ steps.install_cc.outputs.cc }}
87-
CXX: ${{ steps.install_cc.outputs.cxx }}
73+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/configure_conan
74+
with:
75+
conan-version: ${{ inputs.conan-version }}
76+
77+
- name: add conan user
8878
run: |
89-
pip3 install "conan==${{ inputs.conan-version }}"
90-
91-
# conan profile update is deprecated (https://github.com/conan-io/conan/issues/13205)
92-
# and they don't want you to use detect because it is unstable
93-
94-
conan profile detect # Force creation of conan directory structure, will be overwritten
95-
96-
echo '{% set compiler, version = detect_api.detect_compiler() %}' > ~/.conan2/profiles/default
97-
echo '[settings]' >> ~/.conan2/profiles/default
98-
echo 'os={{ detect_api.detect_os() }}' >> ~/.conan2/profiles/default
99-
echo 'arch={{ detect_api.detect_arch() }}' >> ~/.conan2/profiles/default
100-
echo 'build_type=Release' >> ~/.conan2/profiles/default
101-
echo 'compiler={{ compiler }}' >> ~/.conan2/profiles/default
102-
echo 'compiler.version={{ detect_api.default_compiler_version(compiler, version) }}' >> ~/.conan2/profiles/default
103-
echo 'compiler.libcxx=libstdc++11' >> ~/.conan2/profiles/default
104-
10579
conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
10680
conan remote login -p "${{ secrets.CONAN_PW }}" dice-group "${{ secrets.CONAN_USER }}"
10781

0 commit comments

Comments
 (0)