0

I have the following steps to publish and upload some files to artifact:

   - 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

The Build succeeded however after downloading the artifact, I see the following structure:

enter image description here

Is there a way to update the above code such that artifact will contain the following structure?

enter image description here

user989988
  • 3,006
  • 7
  • 44
  • 91
  • This should help you: https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo?rq=1 + Moving output 2 inside the first folder – Itay Brenner Sep 24 '20 at 23:52
  • Does this answer your question? [Download a single folder or directory from a GitHub repo](https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo) – Itay Brenner Sep 24 '20 at 23:53
  • No, my question is regarding GitHub Actions yml file. The link that you shared doesn't match that. – user989988 Sep 24 '20 at 23:59

1 Answers1

1

If a wildcard pattern is used, the path hierarchy will be preserved after the first wildcard pattern.

source: 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/**
riQQ
  • 9,878
  • 7
  • 49
  • 66