code.gitea.io/gitea@v1.22.3/docs/content/usage/packages/conan.zh-cn.md (about)

     1  ---
     2  date: "2021-07-20T00:00:00+00:00"
     3  title: "Conan 软件包注册表"
     4  slug: "conan"
     5  sidebar_position: 20
     6  draft: false
     7  toc: false
     8  menu:
     9    sidebar:
    10      parent: "packages"
    11      name: "Conan"
    12      sidebar_position: 20
    13      identifier: "conan"
    14  ---
    15  
    16  # Conan 软件包注册表
    17  
    18  为您的用户或组织发布 [Conan](https://conan.io/) 软件包。
    19  
    20  ## 要求
    21  
    22  要使用 [conan](https://conan.io/downloads.html) 软件包注册表,您需要使用 conan 命令行工具来消费和发布软件包。
    23  
    24  ## 配置软件包注册表
    25  
    26  要注册软件包注册表,您需要配置一个新的 Conan remote:
    27  
    28  ```shell
    29  conan remote add {remote} https://gitea.example.com/api/packages/{owner}/conan
    30  conan user --remote {remote} --password {password} {username}
    31  ```
    32  
    33  | 参数       | 描述                                                                                                                                        |
    34  | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
    35  | `remote`   | 远程名称。                                                                                                                                  |
    36  | `username` | 您的 Gitea 用户名。                                                                                                                         |
    37  | `password` | 您的 Gitea 密码。如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。 |
    38  | `owner`    | 软件包的所有者。                                                                                                                            |
    39  
    40  例如:
    41  
    42  ```shell
    43  conan remote add gitea https://gitea.example.com/api/packages/testuser/conan
    44  conan user --remote gitea --password password123 testuser
    45  ```
    46  
    47  ## 发布软件包
    48  
    49  通过运行以下命令发布 Conan 软件包:
    50  
    51  ```shell
    52  conan upload --remote={remote} {recipe}
    53  ```
    54  
    55  | 参数     | 描述            |
    56  | -------- | --------------- |
    57  | `remote` | 远程名称        |
    58  | `recipe` | 要上传的 recipe |
    59  
    60  For example:
    61  
    62  ```shell
    63  conan upload --remote=gitea ConanPackage/1.2@gitea/final
    64  ```
    65  
    66  Gitea Conan 软件包注册表支持完整的[版本修订](https://docs.conan.io/en/latest/versioning/revisions.html)。
    67  
    68  ## 安装软件包
    69  
    70  要从软件包注册表中安装Conan软件包,请执行以下命令:
    71  
    72  ```shell
    73  conan install --remote={remote} {recipe}
    74  ```
    75  
    76  | 参数     | 描述            |
    77  | -------- | --------------- |
    78  | `remote` | 远程名称        |
    79  | `recipe` | 要下载的 recipe |
    80  
    81  例如:
    82  
    83  ```shell
    84  conan install --remote=gitea ConanPackage/1.2@gitea/final
    85  ```
    86  
    87  ## 支持的命令
    88  
    89  ```
    90  conan install
    91  conan get
    92  conan info
    93  conan search
    94  conan upload
    95  conan user
    96  conan download
    97  conan remove
    98  ```