GitHub Actions中Build的工件结构

时间:2020-09-24 20:15:08

标签: github github-actions

我有以下步骤将一些文件发布并上传到工件:

   - name: dotnet publish FA1
     run: dotnet publish Service/FA1/FA1.csproj --configuration Release --output fa1_publish_output
       
    - name: dotnet publish FA2
      run: dotnet publish Service/FA2/FA2.csproj --configuration Release --output fa2_publish_output
    
    - name: publish files to artifact
      uses: actions/upload-artifact@v2
      with:
        name: ${{github.run_number}}
        path: |
          fa1_publish_output
          fa2_publish_output

构建成功,但是下载工件后,我看到以下结构:

enter image description here

有没有一种方法可以更新上面的代码,使工件包含以下结构?

enter image description here

1 个答案:

答案 0 :(得分:1)

如果使用通配符模式,则路径层次结构将在第一个通配符模式之后保留。

来源:https://github.com/actions/upload-artifact/tree/27bce4eee761b5bc643f46a8dfb41b430c8d05f6#upload-using-multiple-paths-and-exclusions

    - name: dotnet publish FA1
      run: dotnet publish Service/FA1/FA1.csproj --configuration Release --output upload/Function_Apps/fa1_publish_output
       
    - name: dotnet publish FA2
      run: dotnet publish Service/FA2/FA2.csproj --configuration Release --output upload/Function_Apps/fa2_publish_output
    
    - name: publish files to artifact
      uses: actions/upload-artifact@v2
      with:
        name: ${{github.run_number}}
        path: upload/**