Skip to content

Commit 136c9e7

Browse files
committed
using conan_package_tools
1 parent 95171d9 commit 136c9e7

File tree

8 files changed

+62
-13
lines changed

8 files changed

+62
-13
lines changed

.github/ci/entrypoint.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/conan-remotes/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM conanio/gcc8 AS base
2+
3+
LABEL "com.github.actions.name"="conan-remotes"
4+
LABEL "com.github.actions.description"="Adds Conan remotes from environment variables"
5+
LABEL "description"="Adds Conan remotes from environment variables"
6+
LABEL "maintainer"="Dmitry Arkhipov <grisumbras@gmail.com>"
7+
8+
USER root
9+
ADD entrypoint.sh /entrypoint.sh
10+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh -l
2+
3+
eval "$(pyenv init -)"
4+
eval "$(pyenv virtualenv-init -)"
5+
6+
if [ x != "x$CONAN_UPLOAD" ]; then
7+
conan remote add upload_repo $CONAN_UPLOAD
8+
fi
9+
10+
i=1
11+
old_ifs=$IFS
12+
IFS=,
13+
for r in $CONAN_REMOTES; do
14+
conan remote add env_remote_$i "$r"
15+
i=$(($i+1))
16+
done
17+
IFS=$old_ifs

.github/ci/Dockerfile renamed to .github/cpt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM conanio/gcc8 AS base
22

3-
LABEL "com.github.actions.name"="Conan build"
3+
LABEL "com.github.actions.name"="conan-build"
44
LABEL "com.github.actions.description"="Builds a Conan package"
55

66
LABEL "maintainer"="Dmitry Arkhipov <grisumbras@gmail.com>"

.github/cpt/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh -l
2+
3+
eval "$(pyenv init -)"
4+
eval "$(pyenv virtualenv-init -)"
5+
if [ x != "x$CONAN_UPLOAD" ]; then
6+
conan remote add upload_repo $CONAN_UPLOAD
7+
fi
8+
python build.py

.github/main.workflow

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ workflow "CI" {
33
resolves = "build"
44
}
55

6+
7+
action "remotes" {
8+
uses = "./.github/conan-remotes/"
9+
env = {
10+
CONAN_REMOTES = "https://api.bintray.com/conan/bincrafters/public-conan"
11+
CONAN_UPLOAD = "https://api.bintray.com/conan/grisumbras/conan"
12+
}
13+
}
14+
15+
616
action "build" {
7-
uses = "./.github/ci/"
17+
needs = "remotes"
18+
uses = "./.github/cpt/"
19+
env = {
20+
CONAN_CHANNEL = "testing"
21+
CONAN_PRINT_RUN_COMMANDS = "1"
22+
CONAN_REMOTES = "https://api.bintray.com/conan/bincrafters/public-conan"
23+
CONAN_UPLOAD = "https://api.bintray.com/conan/grisumbras/conan"
24+
CONAN_USERNAME = "grisumbras"
25+
}
826
}

build.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from cpt.packager import ConanMultiPackager
2+
3+
4+
if __name__ == "__main__":
5+
builder = ConanMultiPackager()
6+
builder.add()
7+
builder.run()

conanfile.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,5 @@ class EnumFlagsConan(b2.B2.Mixin, ConanFile):
2121
no_copy_source = True
2222
build_requires = "boost_build/[>=1.68]@bincrafters/stable"
2323

24-
def b2_setup_builder(self, builder):
25-
print(self.source_folder, self.build_folder)
26-
return builder
27-
2824
def package_info(self):
2925
self.info.header_only()

0 commit comments

Comments
 (0)