@@ -8,7 +8,6 @@ const tc = require('@actions/tool-cache')
88const common = require ( './common' )
99const rubyBuilderVersions = require ( './ruby-builder-versions' )
1010
11- const builderReleaseTag = 'toolcache'
1211const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
1312
1413const windows = common . windows
@@ -105,33 +104,21 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
105104function 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