本文档翻译自:https://docs.conan.io/en/latest/reference/commands/creator/upload.html

    1. $ conan upload [-h] [-p PACKAGE] [-q QUERY] [-r REMOTE] [--all]
    2. [--skip-upload] [--force] [--check] [-c] [--retry RETRY]
    3. [--retry-wait RETRY_WAIT] [-no [{all,recipe}]] [-j JSON]
    4. [--parallel]
    5. pattern_or_reference

    将配方和二进制软件包上传到远程服务器。
    如果未指定任何远程服务器,则将使用第一个配置的远程服务器(默认情况下为conan-center,使用“ conan remote list”查看远程服务器列表)。

    1. positional arguments:
    2. pattern_or_reference Pattern, recipe reference or package reference e.g.,
    3. 'boost/*', 'MyPackage/1.2@user/channel', 'MyPackage/1.
    4. 2@user/channel:af7901d8bdfde621d086181aa1c495c25a17b13
    5. 7'
    6. optional arguments:
    7. -h, --help show this help message and exit
    8. -p PACKAGE, --package PACKAGE
    9. Package ID [DEPRECATED: use full reference instead]
    10. -q QUERY, --query QUERY
    11. Only upload packages matching a specific query.
    12. Packages query: 'os=Windows AND (arch=x86 OR
    13. compiler=gcc)'. The 'pattern_or_reference' parameter
    14. has to be a reference: MyPackage/1.2@user/channel
    15. -r REMOTE, --remote REMOTE
    16. upload to this specific remote
    17. --all Upload both package recipe and packages
    18. --skip-upload Do not upload anything, just run the checks and the
    19. compression
    20. --force Ignore checks before uploading the recipe: it will
    21. bypass missing fields in the scm attribute and it will
    22. override remote recipe with local regardless of recipe
    23. date
    24. --check Perform an integrity check, using the manifests,
    25. before upload
    26. -c, --confirm Upload all matching recipes without confirmation
    27. --retry RETRY In case of fail retries to upload again the specified
    28. times.
    29. --retry-wait RETRY_WAIT
    30. Waits specified seconds before retry again
    31. -no [{all,recipe}], --no-overwrite [{all,recipe}]
    32. Uploads package only if recipe is the same as the
    33. remote one
    34. -j JSON, --json JSON json file path where the upload information will be
    35. written to
    36. --parallel Upload files in parallel using multiple threads The
    37. default number of launched threads is 8

    Examples:
    上传软件包配方(conanfile.py和导出的文件):

    1. $ conan upload OpenCV/1.4.0@lasote/stable

    上传软件包配方和单个二进制软件包:

    1. $ conan upload OpenCV/1.4.0@lasote/stable:d50a0d523d98c15bb147b18fa7d203887c38be8b

    将软件包配方和所有生成的二进制软件包上传到指定的远程服务器:

    1. $ conan upload OpenCV/1.4.0@lasote/stable --all -r my_remote

    将所有配方和二进制包从我们的本地缓存上传到my_remote,而无需确认:

    1. $ conan upload "*" --all -r my_remote -c

    将OpenCV的配方以及使用设置arch=x86_64和os=Linux构建的任何二进制软件包从我们的本地缓存上传到my_remote:

    1. $ conan upload OpenCV/1.4.0@lasote/stable -q 'arch=x86_64 and os=Linux' -r my_remote

    上传所有本地软件包和配方,以“ Op”开头,重试3次,并在两次上载尝试之间等待10秒:

    1. $ conan upload "Op*" --all -r my_remote -c --retry 3 --retry-wait 10

    如果不更改配方,则上传软件包而不覆盖配方和软件包:

    1. $ conan upload OpenCV/1.4.0@lasote/stable --all --no-overwrite # defaults to --no-overwrite all

    如果软件包已更改,则在不覆盖配方的情况下上传软件包:

    1. $ conan upload OpenCV/1.4.0@lasote/stable --all --no-overwrite recipe

    使用多个线程上传软件包,而无需确认my_remote:

    1. $ conan upload "*" --confirm --parallel -r my_remote

    :::success Waring
    请注意,使用并行上传时,non_interactive模式将被强制为true :::