Skip to content

Commit a29fab3

Browse files
committed
.github/workflows: use Ruby provided by runners
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.
1 parent fef3ea6 commit a29fab3

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
# annotated tags into lightweight ones, breaking "git describe".
2222
# See https://github.com/actions/checkout/issues/290 and
2323
# https://github.com/actions/checkout/issues/882 for details.
24-
- uses: ruby/setup-ruby@v1
25-
- run: gem install asciidoctor
24+
- run: sudo gem install asciidoctor
2625
- uses: actions/setup-go@v5
2726
with:
2827
go-version: ${{ matrix.go }}
@@ -67,11 +66,7 @@ jobs:
6766
fetch-depth: 0
6867
persist-credentials: false
6968
ref: ${{ github.ref }}
70-
- uses: ruby/setup-ruby@v1
7169
- run: gem install asciidoctor
72-
- run: Rename-Item -Path C:\msys64 -NewName msys64-tmp -Force
73-
# We move the MSYS2 installed for Ruby aside to prevent use of its Git,
74-
# which does not honour the PATH we set to our built git-lfs binary.
7570
- uses: actions/setup-go@v5
7671
with:
7772
go-version: '1.23.x'
@@ -88,10 +83,8 @@ jobs:
8883
flavor: minimal
8984
# We install the SDK so as to have access to the msgfmt.exe binary
9085
# from the GNU gettext package.
91-
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" env -u TMPDIR script/cibuild
86+
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" script/cibuild
9287
shell: bash
93-
# We clear the TMPDIR set for Ruby so mktemp and Go use the same
94-
# volume for temporary files.
9588
- run: rm -f commands/mancontent_gen.go
9689
shell: bash
9790
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" make GOARCH=386 -B

.github/workflows/release.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ jobs:
2323
# annotated tags into lightweight ones, breaking "git describe".
2424
# See https://github.com/actions/checkout/issues/290 and
2525
# https://github.com/actions/checkout/issues/882 for details.
26-
- uses: ruby/setup-ruby@v1
2726
- run: gem install asciidoctor
28-
- run: Rename-Item -Path C:\msys64 -NewName msys64-tmp -Force
29-
# We move the MSYS2 installed for Ruby aside to prevent use of its Git,
30-
# which does not honour the PATH we set to our built git-lfs binary.
3127
- uses: actions/setup-go@v5
3228
with:
3329
go-version: ${{ matrix.go }}
@@ -46,21 +42,19 @@ jobs:
4642
# from the GNU gettext package.
4743
- run: mkdir -p bin/releases
4844
shell: bash
49-
# We clear the TMPDIR set for Ruby so mktemp and Go use the same
50-
# volume for temporary files.
51-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=amd64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-amd64-$(git describe).zip
45+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=amd64 go generate && make bin/releases/git-lfs-windows-amd64-$(git describe).zip
5246
shell: bash
5347
env:
5448
FORCE_LOCALIZE: true
55-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=386 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-386-$(git describe).zip
49+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=386 go generate && make bin/releases/git-lfs-windows-386-$(git describe).zip
5650
shell: bash
5751
env:
5852
FORCE_LOCALIZE: true
59-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=arm64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-arm64-$(git describe).zip
53+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=arm64 go generate && make bin/releases/git-lfs-windows-arm64-$(git describe).zip
6054
shell: bash
6155
env:
6256
FORCE_LOCALIZE: true
63-
- run: env -u TMPDIR make release-windows-stage-1
57+
- run: make release-windows-stage-1
6458
shell: bash
6559
env:
6660
FORCE_LOCALIZE: true
@@ -77,7 +71,7 @@ jobs:
7771
file-digest: SHA256
7872
timestamp-rfc3161: http://timestamp.acs.microsoft.com
7973
timestamp-digest: SHA256
80-
- run: env -u TMPDIR make release-windows-stage-2
74+
- run: make release-windows-stage-2
8175
shell: bash
8276
- uses: azure/[email protected]
8377
with:
@@ -92,9 +86,9 @@ jobs:
9286
file-digest: SHA256
9387
timestamp-rfc3161: http://timestamp.acs.microsoft.com
9488
timestamp-digest: SHA256
95-
- run: env -u TMPDIR make release-windows-stage-3
89+
- run: make release-windows-stage-3
9690
shell: bash
97-
- run: env -u TMPDIR make release-windows-rebuild
91+
- run: make release-windows-rebuild
9892
shell: bash
9993
- uses: actions/upload-artifact@v4
10094
with:
@@ -113,7 +107,6 @@ jobs:
113107
fetch-depth: 0
114108
persist-credentials: false
115109
ref: ${{ github.ref }}
116-
- uses: ruby/setup-ruby@v1
117110
- run: gem install asciidoctor
118111
- uses: actions/setup-go@v5
119112
with:
@@ -151,8 +144,7 @@ jobs:
151144
fetch-depth: 0
152145
persist-credentials: false
153146
ref: ${{ github.ref }}
154-
- uses: ruby/setup-ruby@v1
155-
- run: gem install asciidoctor
147+
- run: sudo gem install asciidoctor
156148
- uses: actions/setup-go@v5
157149
with:
158150
go-version: ${{ matrix.go }}
@@ -188,8 +180,7 @@ jobs:
188180
fetch-depth: 0
189181
persist-credentials: false
190182
ref: ${{ github.ref }}
191-
- uses: ruby/setup-ruby@v1
192-
- run: gem install packagecloud-ruby
183+
- run: sudo gem install packagecloud-ruby
193184
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
194185
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh)
195186
- run: ./docker/run_dockers.bsh --prune
@@ -206,8 +197,7 @@ jobs:
206197
fetch-depth: 0
207198
persist-credentials: false
208199
ref: ${{ github.ref }}
209-
- uses: ruby/setup-ruby@v1
210-
- run: gem install packagecloud-ruby
200+
- run: sudo gem install packagecloud-ruby
211201
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
212202
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh --arch=arm64 debian_11 debian_12)
213203
- run: ./docker/run_dockers.bsh --prune --arch=arm64 debian_11 debian_12

0 commit comments

Comments
 (0)