tcnksm / ghr

Upload multiple artifacts to GitHub Release in parallel
http://tcnksm.github.io/ghr/
MIT License
1.23k stars 80 forks source link

failed to find assets (circleci) #128

Closed VPraharsha03 closed 3 years ago

VPraharsha03 commented 3 years ago

Reference: https://circleci.com/blog/publishing-to-github-releases-via-circleci/ From the example given in the above blog post

ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ./artifacts/

gives out the error: Failed to find assets from ./artifacts/: no local assets are found when publishing out the release

Do i need the additional step store_artifacts in build: ? and store to the /artifacts dir ? eg:

       - store_artifacts:
           path: ./artifacts
rokibhasansagar commented 3 years ago

@VPraharsha03, As they said in the blog,

./artifacts/ - Then we set the PATH to find the artifacts. In this case, everything in a directory called artifacts inside the current directory.

You definitely don't need to attach any workspace if you have only one job in a workflow. Just replace the ./artifacts/ directory with the absolute/relative path of the file/folder that you want to upload as Release.

Example:

# To release multiple content from a folder 
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} "/path/to/content_for_release_having_multiple_files/"
# To release a single file
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} "/path/to/content_for_release/single_file_for_release"
VPraharsha03 commented 3 years ago

@rokibhasansagar Yes, i kept two jobs earlier, now i've changed it to a single job, after some debugging and changes i could get things fixed.