-
Notifications
You must be signed in to change notification settings - Fork 785
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
Auto update Ruby definition with Ruby releases #2430
Conversation
@@ -24,7 +26,17 @@ else | |||
exit 1 | |||
fi | |||
|
|||
openssl_url="https://www.openssl.org/source/openssl-${openssl_version}.tar.gz" | |||
if command -v sha256sum >/dev/null; then | |||
openssl_sha256=$(sha256sum "$release_directory/$openssl_basename" | cut -d ' ' -f 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to download the openssl archive before this line, otherwise it won't be there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it's done in the workflow, I see. That doesn't seem practical if this script is ever run manually though.
.github/workflows/update-ruby.yml
Outdated
git config user.name "GitHub Actions Bot" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "rake sync" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Add Ruby ${{ env.RUBY_VERSION }}"
is a much better message
.github/workflows/update-ruby.yml
Outdated
git commit -m "rake sync" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is using the default GITHUB_TOKEN it will not trigger other workflows like https://github.com/rbenv/ruby-build/blob/master/.github/workflows/mirror.yml
That seems a problem, as that one should run.
It will also not trigger the ci workflow, which doesn't seem good.
That could result in the archive not being mirrored or having an incorrect checksum, etc.
A solution is to use a PAT for this.
Or instead of pushing to create a PR, I think that's safer and clearer what's going on.
That's what I'm using for setup-ruby:
https://github.com/ruby/ruby-builder/blob/master/.github/actions/create-pr-to-setup-ruby/action.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I use https://github.com/rbenv/ruby-build/blob/master/.github/workflows/release.yml#L19 for this.
curl -sL https://cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.gz | ||
curl -sL https://www.openssl.org/source/openssl-${{ env.OPENSSL_VERSION }}.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these lines supposed to do or verify something? If we wanted to download these URLs to local files, I do not think curl will do it unless -O
was used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added -O
at e12c32f
Background:
I and release manager of Ruby improve release workflow recently. I make this manual workflow to automated workflow.
After Ruby release, ruby/ruby#11286 notify to related repositories like docker image, snap package and etc.
I would like to create new definition of ruby-build with above notification. This PR makes it with repository_dispatch feature. After that, we can update definition with simple REST call like: