在Artifact中发布到单独的文件夹(GitHub Action)

时间:2020-09-24 01:41:29

标签: github github-actions

我有以下步骤来发布和上传一些文件:

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

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

fa1_publish_output包含一个文件host.json和一个文件夹fa1

fa2_publish_output包含一个文件host.json和一个文件夹fa2

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

enter image description here

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

fa1_app -> host.json
           fa1

fa2_app -> host.json
           fa2

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

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