Skip to content

Conversation

@chrisd8088
Copy link
Member

@chrisd8088 chrisd8088 commented Feb 7, 2025

The default runners provided by GitHub Actions for the macOS, Windows, and Ubuntu Linux platforms are now all provisioned with an installation of Ruby 3.x, which along with the asciidoctor and packagecloud-ruby gems is all we require to run the several Ruby scripts used by our CI and release workflows.

We can therefore remove the ruby/setup-ruby action from our workflows. On Windows in particular this also allows us to remove the special handling of the TMPDIR environment variable and the MSYS2 environment, since these will no longer be installed by the ruby/setup-ruby action.

On the Ubuntu Linux runners, we do have to run the gem command with sudo as it otherwise encounters a file permission error trying to install our gems.

Note that the changes to our release workflow in this PR have been validated with a successful Actions run in a private repository.

@chrisd8088 chrisd8088 added the github_actions Pull requests that update GitHub Actions code label Feb 7, 2025
@chrisd8088 chrisd8088 requested a review from a team as a code owner February 7, 2025 07:14
In PR git-lfs#3840 we introduced a GitHub Actions workflow to build our
release assets when we push a new version tag.  As a final step in this
workflow we run our script/packagecloud.rb script, which requires the
use of the "packagecloud-ruby" Ruby gem.  At the time, these
requirements meant we needed to first execute the actions/setup-ruby
action so we could then install the gem and run our Ruby script.

Later, in PR git-lfs#4230, we added steps to our CI workflow to build our
manual pages, and since these required the use of the "ronn" Ruby gem,
we also added the actions/setup-ruby action to our CI workflow.
(We subsequently migrated our manual page source files to the AsciiDoc
format, in PR git-lfs#5054, but we continue to use Ruby and the "asciidoctor"
gem to build our manual pages.)

Then in commit b7fa3a5 of PR git-lfs#5236 we
upgraded both of our Actions workflows to use the ruby/setup-ruby
action instead of the now-deprecated actions/setup-ruby one.  Because
the ruby/setup-ruby action installs the MSYS2 environment on Windows
and sets several key environment variables like PATH and TMPDIR, we
also introduced steps to make sure our CI and release processes
continued to work as expected in this context, by clearing the
TMPDIR variable and renaming the directory containing the MSYS2
executables.

Fortunately, the default runners provided by GitHub Actions for the
macOS, Windows, and Ubuntu Linux platforms are now all provisioned with
an installation of Ruby 3.x which includes the "gem" utility we need to
install the "asciidoctor" and "packagecloud-ruby" gems.  As these are
all we require to run our Ruby scripts, we no longer need the more
extensive Ruby development environment provided by the ruby/setup-ruby
action.

We can therefore simply remove the ruby/setup-ruby steps from our
workflows, along with all the special handling of the MSYS2 environment
and the TMPDIR environment variable on Windows.
@chrisd8088 chrisd8088 merged commit d0d1ed0 into git-lfs:main Feb 10, 2025
10 checks passed
@chrisd8088 chrisd8088 deleted the use-default-actions-ruby branch February 10, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants