@@ -8,7 +8,6 @@ const tc = require('@actions/tool-cache')
8
8
const common = require ( './common' )
9
9
const rubyBuilderVersions = require ( './ruby-builder-versions' )
10
10
11
- const builderReleaseTag = 'toolcache'
12
11
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
13
12
14
13
const windows = common . windows
@@ -105,33 +104,21 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
105
104
function getDownloadURL ( platform , engine , version ) {
106
105
let builderPlatform = null
107
106
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 ( ) } `
113
108
} 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 ( ) } `
119
110
} 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 ( ) } `
125
112
}
126
113
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 ( ) } ` )
129
116
}
130
117
131
118
if ( common . isHeadVersion ( version ) ) {
132
119
return getLatestHeadBuildURL ( builderPlatform , engine , version )
133
120
} else {
134
- return `${ releasesURL } /download/${ builderReleaseTag } /${ engine } -${ version } -${ builderPlatform } .tar.gz`
121
+ return `${ releasesURL } /download/${ engine } - ${ version } /${ engine } -${ version } -${ builderPlatform } .tar.gz`
135
122
}
136
123
}
137
124
0 commit comments