flatbuffers/conan/build.py

51 lines
1.7 KiB
Python
Raw Normal View History

Conan build packages on CI (#4590) (#4594) * Build Conan package on Travis CI (#4590) - Added multi package support on Linux, running on Travis CI - Only upload when branch is a tag and named "vX.Y.Z" - Replace Conan injection by Conan wrapper - Removed os_build os_arch -- Conan 1.0.1 hotfix Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on OSX (#4590) - Added jobs to build Flatbuffers on OSX running on Travis Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on Windows (#4590) - Added support necessary to build Flatbuffers on Windows (conan) - Added Appveyor jobs to build Conan package - Only build Conan package when release (tag) Signed-off-by: Uilian Ries <uilianries@gmail.com> * Reduce Conan CI support to simple scripts (#4590) - Removed msvc 10 x86_64 workaround - Updated conan remote address - Added Bincrafters' package tools Signed-off-by: Uilian Ries <uilianries@gmail.com> * Add fPIC option on Conan recipe (#4590) - Add fPIC as optional. It works on Linux and OSX - Update recipe metadata: author, homepage, license - Checking for flatc and flathash on Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on CI (#4590) - Add rule to run conan job only for tags - Run Conan on Linux, OSX and Windows - Update package tool to new interface Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update Conan username (#4590) - Use google as default username Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update OSX version on CI (#4590) - Use latest OSX 9.3 version to build Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-08-16 19:17:52 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import subprocess
from cpt.packager import ConanMultiPackager
Conan build packages on CI (#4590) (#4594) * Build Conan package on Travis CI (#4590) - Added multi package support on Linux, running on Travis CI - Only upload when branch is a tag and named "vX.Y.Z" - Replace Conan injection by Conan wrapper - Removed os_build os_arch -- Conan 1.0.1 hotfix Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on OSX (#4590) - Added jobs to build Flatbuffers on OSX running on Travis Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on Windows (#4590) - Added support necessary to build Flatbuffers on Windows (conan) - Added Appveyor jobs to build Conan package - Only build Conan package when release (tag) Signed-off-by: Uilian Ries <uilianries@gmail.com> * Reduce Conan CI support to simple scripts (#4590) - Removed msvc 10 x86_64 workaround - Updated conan remote address - Added Bincrafters' package tools Signed-off-by: Uilian Ries <uilianries@gmail.com> * Add fPIC option on Conan recipe (#4590) - Add fPIC as optional. It works on Linux and OSX - Update recipe metadata: author, homepage, license - Checking for flatc and flathash on Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on CI (#4590) - Add rule to run conan job only for tags - Run Conan on Linux, OSX and Windows - Update package tool to new interface Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update Conan username (#4590) - Use google as default username Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update OSX version on CI (#4590) - Use latest OSX 9.3 version to build Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-08-16 19:17:52 +00:00
def get_branch():
try:
for line in subprocess.check_output("git branch", shell=True).decode().splitlines():
line = line.strip()
if line.startswith("*") and " (HEAD detached" not in line:
return line.replace("*", "", 1).strip()
return ""
except Exception:
pass
return ""
def get_version():
version = get_branch()
match = re.search(r"v(\d+\.\d+\.\d+.*)", version)
if match:
return match.group(1)
return version
def get_reference(username):
return "flatbuffers/{}@google/stable".format(get_version())
Conan build packages on CI (#4590) (#4594) * Build Conan package on Travis CI (#4590) - Added multi package support on Linux, running on Travis CI - Only upload when branch is a tag and named "vX.Y.Z" - Replace Conan injection by Conan wrapper - Removed os_build os_arch -- Conan 1.0.1 hotfix Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on OSX (#4590) - Added jobs to build Flatbuffers on OSX running on Travis Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on Windows (#4590) - Added support necessary to build Flatbuffers on Windows (conan) - Added Appveyor jobs to build Conan package - Only build Conan package when release (tag) Signed-off-by: Uilian Ries <uilianries@gmail.com> * Reduce Conan CI support to simple scripts (#4590) - Removed msvc 10 x86_64 workaround - Updated conan remote address - Added Bincrafters' package tools Signed-off-by: Uilian Ries <uilianries@gmail.com> * Add fPIC option on Conan recipe (#4590) - Add fPIC as optional. It works on Linux and OSX - Update recipe metadata: author, homepage, license - Checking for flatc and flathash on Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on CI (#4590) - Add rule to run conan job only for tags - Run Conan on Linux, OSX and Windows - Update package tool to new interface Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update Conan username (#4590) - Use google as default username Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update OSX version on CI (#4590) - Use latest OSX 9.3 version to build Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-08-16 19:17:52 +00:00
if __name__ == "__main__":
login_username = os.getenv("CONAN_LOGIN_USERNAME", "aardappel")
username = os.getenv("CONAN_USERNAME", "google")
upload = os.getenv("CONAN_UPLOAD", "https://api.bintray.com/conan/aardappel/flatbuffers")
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)
builder = ConanMultiPackager(reference=get_reference(username),
username=username,
Conan build packages on CI (#4590) (#4594) * Build Conan package on Travis CI (#4590) - Added multi package support on Linux, running on Travis CI - Only upload when branch is a tag and named "vX.Y.Z" - Replace Conan injection by Conan wrapper - Removed os_build os_arch -- Conan 1.0.1 hotfix Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on OSX (#4590) - Added jobs to build Flatbuffers on OSX running on Travis Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on Windows (#4590) - Added support necessary to build Flatbuffers on Windows (conan) - Added Appveyor jobs to build Conan package - Only build Conan package when release (tag) Signed-off-by: Uilian Ries <uilianries@gmail.com> * Reduce Conan CI support to simple scripts (#4590) - Removed msvc 10 x86_64 workaround - Updated conan remote address - Added Bincrafters' package tools Signed-off-by: Uilian Ries <uilianries@gmail.com> * Add fPIC option on Conan recipe (#4590) - Add fPIC as optional. It works on Linux and OSX - Update recipe metadata: author, homepage, license - Checking for flatc and flathash on Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com> * Build Conan package on CI (#4590) - Add rule to run conan job only for tags - Run Conan on Linux, OSX and Windows - Update package tool to new interface Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update Conan username (#4590) - Use google as default username Signed-off-by: Uilian Ries <uilianries@gmail.com> * Update OSX version on CI (#4590) - Use latest OSX 9.3 version to build Conan package Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-08-16 19:17:52 +00:00
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)
builder.run()