-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete Conan packages building and uploading
- Loading branch information
Showing
8 changed files
with
264 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
if os.getenv("APPVEYOR_REPO_TAG") != "true": | ||
print("Skip build step. It's not TAG") | ||
else: | ||
os.system("python conan/build.py") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
if os.getenv("APPVEYOR_REPO_TAG") != "true": | ||
print("Skip step. It's not TAG") | ||
else: | ||
os.system("pip install conan conan-package-tools") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from cpt.packager import ConanMultiPackager | ||
import os | ||
|
||
def set_appveyor_environment(): | ||
if os.getenv("APPVEYOR") is not None: | ||
os.environ["CONAN_STABLE_BRANCH_PATTERN"] = os.getenv("CONAN_STABLE_BRANCH_PATTERN", "master") | ||
os.environ["CONAN_ARCHS"] = os.getenv("CONAN_ARCHS", "x86,x86_64") | ||
os.environ["CONAN_BUILD_TYPES"] = os.getenv("CONAN_BUILD_TYPES", "Release,Debug").replace('"', '') | ||
os.environ["CONAN_PACKAGE_VERSION"] = os.getenv("CONAN_PACKAGE_VERSION", os.getenv("APPVEYOR_REPO_TAG_NAME")) | ||
|
||
if __name__ == "__main__": | ||
set_appveyor_environment() | ||
login_username = os.getenv("CONAN_LOGIN_USERNAME") | ||
username = os.getenv("CONAN_USERNAME") | ||
tag_version = os.getenv("CONAN_PACKAGE_VERSION", os.getenv("TRAVIS_TAG")) | ||
package_version = tag_version.replace("v", "") | ||
package_name_unset = "SET-CONAN_PACKAGE_NAME-OR-CONAN_REFERENCE" | ||
package_name = os.getenv("CONAN_PACKAGE_NAME", package_name_unset) | ||
reference = "{}/{}".format(package_name, package_version) | ||
channel = os.getenv("CONAN_CHANNEL", "stable") | ||
upload = os.getenv("CONAN_UPLOAD") | ||
stable_branch_pattern = os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+.*") | ||
test_folder = os.getenv("CPT_TEST_FOLDER", os.path.join("conan", "test_package")) | ||
upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True) | ||
|
||
disable_shared = os.getenv("CONAN_DISABLE_SHARED_BUILD", "False") | ||
if disable_shared == "True" and package_name == package_name_unset: | ||
raise Exception("CONAN_DISABLE_SHARED_BUILD: True is only supported when you define CONAN_PACKAGE_NAME") | ||
|
||
builder = ConanMultiPackager(username=username, | ||
reference=reference, | ||
channel=channel, | ||
login_username=login_username, | ||
upload=upload, | ||
stable_branch_pattern=stable_branch_pattern, | ||
upload_only_when_stable=upload_only_when_stable, | ||
test_folder=test_folder) | ||
builder.add_common_builds(pure_c=False) | ||
|
||
filtered_builds = [] | ||
for settings, options, env_vars, build_requires, reference in builder.items: | ||
if disable_shared == "False" or not options["{}:shared".format(package_name)]: | ||
filtered_builds.append([settings, options, env_vars, build_requires]) | ||
builder.builds = filtered_builds | ||
|
||
builder.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
if [[ "$(uname -s)" == 'Darwin' ]]; then | ||
if which pyenv > /dev/null; then | ||
eval "$(pyenv init -)" | ||
fi | ||
pyenv activate conan | ||
fi | ||
|
||
conan user | ||
python conan/build.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
if [[ "$(uname -s)" == 'Darwin' ]]; then | ||
brew update || brew update | ||
brew outdated pyenv || brew upgrade pyenv | ||
brew install pyenv-virtualenv | ||
brew install cmake || true | ||
|
||
if which pyenv > /dev/null; then | ||
eval "$(pyenv init -)" | ||
fi | ||
|
||
pyenv install 3.7.1 | ||
pyenv virtualenv 3.7.1 conan | ||
pyenv rehash | ||
pyenv activate conan | ||
fi | ||
|
||
pip install -U conan_package_tools conan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters