CChenyt26
7473c826创建于 2022年8月9日历史提交
name: PyPI Cloudartifact Action Install Demo
on:
  push:
    branches:
       master
jobs:
  Install-from-CloudArtifact-PyPI:
    runs-on: ubuntu-latest
    steps:
        # 代码检出
      - uses: actions/checkout@v2

        # GitHub Action环境默认python版本为3.8.X,可以根据自己项目需求修改python版本
      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.8

        # 华为云CloudArtifact PyPI 私仓配置 
        # action的index-url可以这样设置:https://${{ secrets.PyPI_AUTH }}@xxx.xxx.xxx/artgalaxy/api/pypi/cn-north-4_dfbdbf2e511e**********653358d65c_pypi_0/simple
        # ${{ secrets.PyPI_AUTH }}的内容是:从华为云私有库获取PyPI的index-url中的{username}:{password}
      - name: Setup Huawei Cloud PyPI CloudArtifact
        uses: huaweicloud/PyPI-cloudartifact-action@v1.1.0
        with: 
          pypi-operation-type: install
          index-url: '<repository URL with authentication>'
          trusted-host: '<repository URL host>'

        # 拉取CloudArtifact PyPI 私仓的PyPI package  
      - name: Install PyPI package 
        run: |
          pip install <PyPI name>