upload-rust-binary-action icon indicating copy to clipboard operation
upload-rust-binary-action copied to clipboard

How to upload to gitHub artifact

Open ahaoboy opened this issue 1 year ago • 4 comments

I want to publish the artifact to gitHub for each pr or commit so that it can be downloaded for testing, and publish the tag to github release. Is there any solution to achieve this? It is necessary to ensure that the release and artifact use the same compilation steps, so it would be useful to add a parameter artifact: true

ahaoboy avatar Oct 15 '24 09:10 ahaoboy

Do you mean you want to do something like this?

(Now that outputs have been implemented, getting the filename is easier than when that code was written.)

taiki-e avatar Oct 15 '24 09:10 taiki-e

It's easier to add a field than using some magic bash script, and this script doesn't work on Windows. upload-rust-binary-action seems to have to read the tag information, so it can't be executed on every commit

https://github.com/ahaoboy/ansi2/actions/runs/11343461783

ahaoboy avatar Oct 15 '24 09:10 ahaoboy

this script doesn't work on Windows

Try shell: bash or setting shell globally.

upload-rust-binary-action seems to have to read the tag information, so it can't be executed on every commit

It also works for events other than tags and releases by specifying the ref option as described here.

If you do not need to upload files for a release, you can use the dry-run option like this.

(The workflow I linked above is the one I actually use on projects like cargo-llvm-cov to make sure the build and archive steps of the release workflow works correctly at PR/push/scheduled job: https://github.com/taiki-e/cargo-llvm-cov/actions/runs/11338153284/job/31531038154)

taiki-e avatar Oct 15 '24 10:10 taiki-e

Thanks for your help, it's a bit tedious but at least it works. It would be nice if it could be built-in.

ahaoboy avatar Oct 15 '24 10:10 ahaoboy