Skip to content

Commit cf7216d

Browse files
committed
Use new releases of ruby-builder per engine-version
* See #810
1 parent 1c58d16 commit cf7216d

File tree

2 files changed

+12
-38
lines changed

2 files changed

+12
-38
lines changed

dist/index.js

Lines changed: 6 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const tc = require('@actions/tool-cache')
88
const common = require('./common')
99
const rubyBuilderVersions = require('./ruby-builder-versions')
1010

11-
const builderReleaseTag = 'toolcache'
1211
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
1312

1413
const windows = common.windows
@@ -105,33 +104,21 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
105104
function getDownloadURL(platform, engine, version) {
106105
let builderPlatform = null
107106
if (platform.startsWith('windows-')) {
108-
if (os.arch() === 'x64') {
109-
builderPlatform = 'windows-latest'
110-
} else if (os.arch() === 'arm64') {
111-
builderPlatform = 'windows-arm64'
112-
}
107+
builderPlatform = `windows-${os.arch()}`
113108
} else if (platform.startsWith('macos-')) {
114-
if (os.arch() === 'x64') {
115-
builderPlatform = 'macos-latest'
116-
} else if (os.arch() === 'arm64') {
117-
builderPlatform = 'macos-13-arm64'
118-
}
109+
builderPlatform = `darwin-${os.arch()}`
119110
} else if (platform.startsWith('ubuntu-')) {
120-
if (os.arch() === 'x64') {
121-
builderPlatform = platform
122-
} else if (os.arch() === 'arm64') {
123-
builderPlatform = `${platform}-arm64`
124-
}
111+
builderPlatform = `${platform}-${os.arch()}`
125112
}
126113

127-
if (builderPlatform === null) {
128-
throw new Error(`Unknown download URL for platform ${platform}`)
114+
if (builderPlatform === null || !['x64', 'arm64'].includes(os.arch())) {
115+
throw new Error(`Unknown download URL for platform ${platform}-${os.arch()}`)
129116
}
130117

131118
if (common.isHeadVersion(version)) {
132119
return getLatestHeadBuildURL(builderPlatform, engine, version)
133120
} else {
134-
return `${releasesURL}/download/${builderReleaseTag}/${engine}-${version}-${builderPlatform}.tar.gz`
121+
return `${releasesURL}/download/${engine}-${version}/${engine}-${version}-${builderPlatform}.tar.gz`
135122
}
136123
}
137124

0 commit comments

Comments
 (0)