actions / upload-artifact

MIT License
3.22k stars 717 forks source link

not find a package for upload #198

Open k-morozov opened 3 years ago

k-morozov commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

Version

Environment

Screenshots If applicable, add screenshots to help explain your problem.

Run/Repo Url If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate. https://github.com/k-morozov/messaging-framework/runs/2512190926?check_suite_focus=true

How to reproduce If applicable, add information on how to reproduce the problem.

I try to download the deb package, but it is not found, although I do a check and it exists in the path.

Run ls /home/runner/work/messaging-framework/messaging-framework/build
CMakeCache.txt
CMakeFiles
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
DartConfiguration.tcl
Makefile
Messaging-framework-0.1.3-Linux.deb
Testing
_CPack_Packages
bin
cmake_install.cmake
conan.lock
conanbuildinfo.cmake
conanbuildinfo.txt
conaninfo.txt
graph_info.json
install_manifest.txt
lib
proto
test

output

Warning: No files were found with the provided path: /__w/messaging-framework/messaging-framework/build/Messaging-framework-0.1.3-Linux.deb. No artifacts will be uploaded.

code:
    - name: Package
      run: |
        cmake --build ${{github.workspace}}/build --target package
        echo ${{github.workspace}}
        echo '/home/runner/work/messaging-framework/messaging-framework'

    - name: Test_dir
      run: ls ${{github.workspace}}/build

    - name: Upload a Build Artifact
      uses: actions/upload-artifact@v2.2.3
      with:
        name: Messaging-framework-0.1.3-Linux.deb
        path: ${{github.workspace}}/build/Messaging-framework-0.1.3-Linux.deb

Additional context Add any other context about the problem here.

jirihnidek commented 3 years ago

I can confirm this behavior. When you specify path of actions/upload-artifact@v2 using e.g. ${{github.workspace}}/path/to/artifact, then environment variable ${{github.workspace}} is just replaced with current directory /__w/path/to/checkout/directory. It is interesting that debug print replace ${{github.workspace}} correctly.

Consider following step:

- name: Store RPMs as artifacts
  uses: actions/upload-artifact@v2
  with:
    name: rpms
    path: ${{github.workspace}}/rpm_build/x86_64/

It produces following error despite ${{github.workspace}}/rpm_build/x86_64/ contains several RPMs.

1s
Run actions/upload-artifact@v2
  with:
    name: rpms
    path: /home/runner/work/daemon/daemon/rpm_build/x86_64/
    if-no-files-found: warn
  env:
    BUILD_TYPE: Release
/usr/bin/docker exec  fa500e71b04a733e9bc7ea41a0374f2c25f48f072cb4986eadcc058916a78425 sh -c "cat /etc/*release | grep ^ID"
Warning: No files were found with the provided path: /__w/daemon/daemon/rpm_build/x86_64/. No artifacts will be uploaded.
es1o commented 1 month ago

I have the same problem. I run my jobs inside container with container: configuration. When I debug I have different ${{github.workspace}} paths for run and for actions/upload-artifact@v4.

When I use run with echo ${{github.workspace}} I see /__w/repo/ but the same variable inside upload-artifact action is /home/runner/_work/repo