@@ -464,7 +464,8 @@ const { download, execSync, getInput } = __webpack_require__(498)
464464 * release contains all Ruby building dependencies,
465465 * used when MSYS2 has server issues
466466 */
467- const RELEASE_ASSET = 'msys2-2020-03-20'
467+ const RELEASE_ASSET = fs . lstatSync ( 'C:\\msys64' ) . isSymbolicLink ( ) ?
468+ 'msys2-2020-03-20' : null
468469
469470// SSD drive, used for most downloads
470471const drive = ( process . env [ 'GITHUB_WORKSPACE' ] || 'C' ) [ 0 ]
@@ -473,7 +474,7 @@ const tar = 'C:\\msys64\\usr\\bin\\tar.exe'
473474
474475// below are for setup of old Ruby DevKit
475476const dirDK = `${ drive } :\\DevKit64`
476- const oldDKTar = `/${ drive } /DevKit64/mingw/x86_64-w64-mingw32`
477+ const dirDKTar = `/${ drive } /DevKit64/mingw/x86_64-w64-mingw32`
477478
478479const dlPath = `${ process . env . RUNNER_TEMP } \\srp`
479480if ( ! fs . existsSync ( dlPath ) ) {
@@ -535,6 +536,7 @@ const openssl = async () => {
535536 const uri = `https://dl.bintray.com/larskanis/rubyinstaller2-packages/${ pre . trim ( ) } openssl-1.0.2.t-1-any.pkg.tar.xz`
536537 const fn = `${ dlPath } \\ri2.tar.xz`
537538 await download ( uri , fn )
539+ execSync ( `pacman.exe -R --noconfirm --noprogressbar ${ pre . trim ( ) } openssl` )
538540 execSync ( `pacman.exe -Udd --noconfirm --noprogressbar ${ fn } ` )
539541 mingw = mingw . replace ( / o p e n s s l / gi, '' ) . trim ( )
540542 }
@@ -587,13 +589,11 @@ const installDevKit = async () => {
587589const setPathDevKit = ( ) => {
588590 let aryPath = process . env . PATH . split ( path . delimiter )
589591 const rubyPath = aryPath . shift ( )
590- // two msys2 paths
591- aryPath . shift ( )
592- aryPath . shift ( )
593- aryPath . unshift ( `${ dirDK } \\mingw\\x86_64-w64-mingw32\\bin` )
594- aryPath . unshift ( `${ dirDK } \\mingw\\bin` )
595- aryPath . unshift ( `${ dirDK } \\bin` )
596- aryPath . unshift ( rubyPath )
592+ // remove two msys2 paths, add devkit paths
593+ aryPath . splice ( 0 , 2 ,
594+ rubyPath , `${ dirDK } \\mingw\\x86_64-w64-mingw32\\bin` ,
595+ `${ dirDK } \\mingw\\bin` , `${ dirDK } \\bin`
596+ )
597597 core . exportVariable ( 'Path' , aryPath . join ( path . delimiter ) )
598598}
599599
@@ -637,7 +637,7 @@ const runMingw = async () => {
637637 let fn = `${ dlPath } \\${ item . pkg } .tar.lzma`
638638 await download ( item . uri , fn )
639639 fn = fn . replace ( / : / , '' ) . replace ( / \\ / g, '/' )
640- let cmd = `${ tar } --lzma -C ${ oldDKTar } -xf /${ fn } `
640+ let cmd = `${ tar } --lzma -C ${ dirDKTar } -xf /${ fn } `
641641 execSync ( cmd )
642642 }
643643 }
@@ -1627,13 +1627,11 @@ module.exports = require("fs");
16271627 else if ( platform === 'darwin' ) { runner = __webpack_require__ ( 924 ) }
16281628 else if ( platform === 'win32' ) {
16291629 const ruby = common . ruby ( )
1630-
1630+
16311631 if ( ruby . platform . includes ( 'mingw' ) ) { runner = __webpack_require__ ( 505 ) }
16321632 else if ( ruby . platform . includes ( 'mswin' ) ) { runner = __webpack_require__ ( 894 ) }
1633- // pass Ruby props to runner
1634- if ( runner ) { runner . setRuby ( ruby ) }
1635-
1636- // choco, vcpkg, etc
1633+
1634+ if ( runner ) { runner . setRuby ( ruby ) } // pass Ruby info to runner
16371635 }
16381636
16391637 if ( runner ) { await runner . run ( ) }
@@ -1733,7 +1731,6 @@ module.exports = __webpack_require__(525);
17331731"use strict" ;
17341732__webpack_require__ . r ( __webpack_exports__ ) ;
17351733/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "setRuby" , function ( ) { return setRuby ; } ) ;
1736- /* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "openssl" , function ( ) { return openssl ; } ) ;
17371734/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "run" , function ( ) { return run ; } ) ;
17381735
17391736
@@ -1743,27 +1740,38 @@ const core = __webpack_require__(276)
17431740const { execSync, getInput } = __webpack_require__ ( 498 )
17441741
17451742let mingw = getInput ( 'mingw' )
1743+ let mswin = getInput ( 'mswin' )
1744+ let choco = getInput ( 'choco' )
17461745let vcpkg = getInput ( 'vcpkg' )
17471746
17481747let ruby // eslint-disable-line no-unused-vars
17491748
17501749const setRuby = ( _ruby ) => { ruby = _ruby }
17511750
1752- // installs 1.1.1d
1753- const openssl = async ( ) => {
1754- execSync ( 'C:\\ProgramData\\Chocolatey\\bin\\choco install --no-progress openssl' )
1755- fs . renameSync ( 'C:\\Program Files\\OpenSSL-Win64' , 'C:\\openssl-win' )
1756- core . exportVariable ( 'SSL_DIR' , '--with-openssl-dir=C:/openssl-win' )
1757- mingw = mingw . replace ( / o p e n s s l / gi, '' ) . trim ( )
1758- }
1759-
17601751const run = async ( ) => {
17611752 try {
1762- if ( mingw . includes ( 'openssl' ) ) { openssl ( ) }
1763-
1753+ if ( mswin !== '' ) {
1754+ execSync ( `pacman.exe -S --noconfirm --noprogressbar --needed ${ mswin } ` )
1755+ }
1756+
1757+ if ( mingw . includes ( 'openssl' ) ) {
1758+ execSync ( `choco install --no-progress openssl` )
1759+ fs . renameSync ( 'C:\\Program Files\\OpenSSL-Win64' , 'C:\\openssl-win' )
1760+ core . exportVariable ( 'SSL_DIR' , '--with-openssl-dir=C:/openssl-win' )
1761+ choco = choco . replace ( / o p e n s s l / gi, '' ) . trim ( )
1762+ }
1763+
1764+ if ( choco !== '' ) {
1765+ execSync ( `choco install --no-progress ${ choco } ` )
1766+ if ( choco . includes ( 'openssl' ) ) {
1767+ fs . renameSync ( 'C:\\Program Files\\OpenSSL-Win64' , 'C:\\openssl-win' )
1768+ core . exportVariable ( 'SSL_DIR' , '--with-openssl-dir=C:/openssl-win' )
1769+ }
1770+ }
1771+
17641772 if ( vcpkg !== '' ) {
17651773 execSync ( `vcpkg --triplet x64-windows install ${ vcpkg } ` )
1766- core . addPath ( ` ${ process . env . VCPKG_INSTALLATION_ROOT } \\ installed\\ x64-windows\\tools `)
1774+ core . exportVariable ( 'OPT_DIR' , `--with-opt-dir= ${ process . env . VCPKG_INSTALLATION_ROOT } / installed/ x64-windows`)
17671775 }
17681776
17691777 } catch ( error ) {
0 commit comments