Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upload to gitHub artifact #85

Open
ahaoboy opened this issue Oct 15, 2024 · 4 comments
Open

How to upload to gitHub artifact #85

ahaoboy opened this issue Oct 15, 2024 · 4 comments
Labels
question Further information is requested

Comments

@ahaoboy
Copy link

ahaoboy commented Oct 15, 2024

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

@taiki-e
Copy link
Owner

taiki-e commented Oct 15, 2024

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 taiki-e added the question Further information is requested label Oct 15, 2024
@ahaoboy
Copy link
Author

ahaoboy commented Oct 15, 2024

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

@taiki-e
Copy link
Owner

taiki-e commented Oct 15, 2024

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)

@ahaoboy
Copy link
Author

ahaoboy commented Oct 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants