mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 15:15:06 +00:00
Update Conan version Automatically (#5027)
* #5026 Add FindFlatBuffers.cmake to Conan Package Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Build Flatbuffers on OSX 10 Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Auto update Conan package version Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Update Conan docker images Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Update tag var on Appveyor Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Filter appveyor brach name Signed-off-by: Uilian Ries <uilianries@gmail.com>
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
ab54e61805
commit
dd8922878d
@@ -1,7 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from cpt.packager import ConanMultiPackager
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from cpt.packager import ConanMultiPackager
|
||||
|
||||
|
||||
def set_appveyor_environment():
|
||||
if os.getenv("APPVEYOR") is not None:
|
||||
@@ -13,6 +16,39 @@ def set_appveyor_environment():
|
||||
os.environ["CONAN_ARCHS"] = ci_platform
|
||||
os.environ["CONAN_BUILD_TYPES"] = os.getenv("Configuration").replace('"', '')
|
||||
|
||||
|
||||
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()
|
||||
if os.getenv("TRAVIS", False):
|
||||
version = os.getenv("TRAVIS_BRANCH")
|
||||
|
||||
if os.getenv("APPVEYOR", False):
|
||||
version = os.getenv("APPVEYOR_REPO_BRANCH")
|
||||
if os.getenv("APPVEYOR_REPO_TAG") == "true":
|
||||
version = os.getenv("APPVEYOR_REPO_TAG_NAME")
|
||||
|
||||
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())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
login_username = os.getenv("CONAN_LOGIN_USERNAME", "aardappel")
|
||||
username = os.getenv("CONAN_USERNAME", "google")
|
||||
@@ -22,7 +58,8 @@ if __name__ == "__main__":
|
||||
upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True)
|
||||
set_appveyor_environment()
|
||||
|
||||
builder = ConanMultiPackager(username=username,
|
||||
builder = ConanMultiPackager(reference=get_reference(username),
|
||||
username=username,
|
||||
login_username=login_username,
|
||||
upload=upload,
|
||||
stable_branch_pattern=stable_branch_pattern,
|
||||
|
||||
Reference in New Issue
Block a user