diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 86d9606..0170a48 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -103,18 +103,20 @@ jobs: steps: - uses: actions/checkout@v2 - name: create_dirs - run: CD .. || MKDIR my_rel my_build + run: MKDIR my_rel my_build - name: configure_and_make run: | - CD .. SET base_dir=%cd% ECHO %base_dir% - CALL maracluster\admin\builders\nativew64_build.bat -s %base_dir% -r %base_dir%\my_rel -b %base_dir%\my_build -g + CD .. + SET src_dir=%cd% + ECHO %src_dir% + CALL maracluster\admin\builders\nativew64_build.bat -s %src_dir% -r %base_dir%\my_rel -b %src_dir%\my_build -g - name: Upload packages uses: actions/upload-artifact@v4 with: name: win64-packages - path: ..\my_rel + path: my_rel pre-release: runs-on: ubuntu-latest diff --git a/admin/builders/_init_msvc_.bat b/admin/builders/_init_msvc_.bat index 2546f6b..7e375e4 100644 --- a/admin/builders/_init_msvc_.bat +++ b/admin/builders/_init_msvc_.bat @@ -1,6 +1,6 @@ set BUILD_TARGET=%1 -call :downloadfile https://github.com/microsoft/vswhere/releases/download/2.8.4/vswhere.exe vswhere.exe +call %~dp0\download_file.bat https://github.com/microsoft/vswhere/releases/download/2.8.4/vswhere.exe vswhere.exe for /f "usebackq tokens=*" %%i in (`.\vswhere.exe -legacy -latest -property installationPath`) do ( set MSVC_INSTALL_DIR=%%i ) @@ -58,9 +58,4 @@ if not defined DevEnvDir ( ) ) -EXIT /B %ERRORLEVEL% - -:downloadfile -echo Downloading %1 to %2 -PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%1','%2')" -EXIT /B +EXIT /B %ERRORLEVEL% \ No newline at end of file diff --git a/admin/builders/_urls_and_file_names_.bat b/admin/builders/_urls_and_file_names_.bat index 232fe4d..d014e13 100644 --- a/admin/builders/_urls_and_file_names_.bat +++ b/admin/builders/_urls_and_file_names_.bat @@ -3,8 +3,8 @@ ::: hardcoded in the respective buiding scripts ::: 7-zip -set ZIP_BASE=7zi -set ZIP_URL=https://kumisystems.dl.sourceforge.net/project/sevenzip/7-Zip/19.00/7z1900.exe +set ZIP_BASE=7zip +set ZIP_URL=https://sourceforge.net/projects/sevenzip/files/7-Zip/24.09/7z2409.exe/download ::: CMake set CMAKE_VERSION=3.23.1 @@ -14,30 +14,42 @@ set CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v%CMAKE_VERSION ::: Proteowizard ::: https://teamcity.labkey.org/viewType.html?buildTypeId=bt81 ::: ::: without-t = without tests ::: -set PWIZ_VERSION_URL=https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/VERSION -call :downloadfile %PWIZ_VERSION_URL% %INSTALL_DIR%\VERSION -set /p PWIZ_VERSION_STRING=<%INSTALL_DIR%\VERSION -set PWIZ_BASE=pwiz-src-without-t-%PWIZ_VERSION_STRING: =_% -set PWIZ_URL=https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/%PWIZ_BASE%.tar.bz2 +set PWIZ_VERSION_URL=https://proteowizard.sourceforge.io/releases/bt81.xml +call %~dp0\download_file.bat %PWIZ_VERSION_URL% bt81.xml +call :extractbuildinfo +echo ✅ PWIZ_BUILD_ID: %PWIZ_BUILD_ID% +echo ✅ PWIZ_FILE_NAME: %PWIZ_FILE_NAME% +set PWIZ_URL=https://mc-tca-01.s3.us-west-2.amazonaws.com/ProteoWizard/bt81/%PWIZ_BUILD_ID%/%PWIZ_FILE_NAME% + ::: remember to update the boost and zlib version when ProteoWizard updates their versions -set BOOST_BASE=boost_1_76_0 +set BOOST_BASE=boost_1_86_0 set ZLIB_BASE=zlib-1.2.3 -::: Boost asio library -set BOOST_ASIO_BASE=boost_asio_1_18_2 -set BOOST_ASIO_URL=https://sourceforge.net/projects/asio/files/asio/1.18.2 (Stable)/%BOOST_ASIO_BASE%.zip/download +::: Boost asio library (note the additional %%% before %20 to prevent interpretation as a variable) +set BOOST_ASIO_BASE=boost_asio_1_30_2 +set BOOST_ASIO_URL=https://sourceforge.net/projects/asio/files/asio/1.30.2%%%%20(Stable)/%BOOST_ASIO_BASE%.zip/download + +::: Boost unordered library +set BOOST_UNORDERED_BASE=unordered-boost-1.86.0 +set BOOST_UNORDERED_URL=https://github.com/boostorg/unordered/archive/refs/tags/boost-1.86.0.zip ::: Qt set QT_BASE=qtbase-opensource-src-5.9.9 set QT_URL=https://download.qt.io/archive/qt/5.9/5.9.9/submodules/%QT_BASE%.zip set JOM_URL=http://download.qt.io/official_releases/jom/jom_1_1_3.zip -::: NSIS -set NSIS_URL=https://sourceforge.net/projects/nsis/files/NSIS 3/3.04/nsis-3.04-setup.exe/download +::: NSIS (note the additional %%% before %20 to prevent interpretation as a variable) +set NSIS_URL=https://sourceforge.net/projects/nsis/files/NSIS%%%%203/3.11/nsis-3.11-setup.exe/download EXIT /B -:downloadfile -PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%1','%2')" -EXIT /B +:: Macro to extract BUILD_ID and FILE_NAME using PowerShell regex +:extractbuildinfo +::: Step 1: Run PowerShell and output extracted strings to temp files +PowerShell "$content = Get-Content -Raw 'bt81.xml'; if ($content -match 'id:(\d+)/artifacts/content/(pwiz-src-without-t-[^<]+?\.tar\.bz2)') { $matches[1] | Out-File -Encoding ASCII 'build_id.tmp' }" +PowerShell "$content = Get-Content -Raw 'bt81.xml'; if ($content -match 'id:(\d+)/artifacts/content/(pwiz-src-without-t-[^<]+?\.tar\.bz2)') { $matches[2] | Out-File -Encoding ASCII 'file_name.tmp' }" +::: Step 2: Read from the temp files into batch variables +set /p PWIZ_BUILD_ID=nul 2>&1 +IF %ERRORLEVEL%==0 ( + curl -L "%URL%" -o "%OUT%" +) ELSE ( + PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%URL%','%OUT%')" +) \ No newline at end of file diff --git a/admin/builders/install_proteowizard.bat b/admin/builders/install_proteowizard.bat index 26ba300..f9365ab 100644 --- a/admin/builders/install_proteowizard.bat +++ b/admin/builders/install_proteowizard.bat @@ -11,7 +11,7 @@ set PWIZ_DIR=%INSTALL_DIR%\proteowizard if not exist "%PWIZ_DIR%\lib" ( echo Downloading and installing ProteoWizard if not exist "%PWIZ_DIR%" ( - call :downloadfile %PWIZ_URL% %INSTALL_DIR%\pwiz.tar.bz2 + call %~dp0\download_file.bat %PWIZ_URL% %INSTALL_DIR%\pwiz.tar.bz2 if not exist "%INSTALL_DIR%\pwiz.tar" ( %ZIP_EXE% x "%INSTALL_DIR%\pwiz.tar.bz2" -o"%INSTALL_DIR%" -aoa > NUL ) @@ -28,6 +28,7 @@ if not exist "%PWIZ_DIR%\lib" ( pwiz/data/msdata//pwiz_data_msdata ^ pwiz/data/msdata//pwiz_data_msdata_version ^ pwiz/data/msdata/mz5//pwiz_data_msdata_mz5 ^ + pwiz/data/msdata/mzmlb//pwiz_data_msdata_mzmlb ^ pwiz/data/proteome//pwiz_data_proteome ^ pwiz/utility/chemistry//pwiz_utility_chemistry ^ pwiz/utility/minimxml//pwiz_utility_minimxml ^ @@ -103,14 +104,13 @@ if not exist "%PWIZ_DIR%\lib" ( for /r pwiz %%x in (*.hpp, *.h) do copy "%%x" include\ /Y > NUL ::: copy the boost::asio library, which is not included by the ProteoWizard boost tar but is needed for maracluster - call :downloadfile "%BOOST_ASIO_URL%" %INSTALL_DIR%\boost_asio.zip + call %~dp0\download_file.bat "%BOOST_ASIO_URL%" %INSTALL_DIR%\boost_asio.zip %ZIP_EXE% x "%INSTALL_DIR%\boost_asio.zip" -o"%INSTALL_DIR%" -aoa > NUL - PowerShell "Copy-Item -Path '%INSTALL_DIR%\%BOOST_ASIO_BASE%\boost' -Destination '%PWIZ_DIR%\libraries\boost_1_76_0' -Recurse -Force" -) - -EXIT /B + PowerShell "Copy-Item -Path '%INSTALL_DIR%\%BOOST_ASIO_BASE%\boost' -Destination '%PWIZ_DIR%\libraries\boost_1_86_0' -Recurse -Force" + call %~dp0\download_file.bat "%BOOST_UNORDERED_URL%" %INSTALL_DIR%\boost_unordered.zip + %ZIP_EXE% x "%INSTALL_DIR%\boost_unordered.zip" -o"%INSTALL_DIR%" -aoa > NUL + PowerShell "Copy-Item -Path '%INSTALL_DIR%\%BOOST_UNORDERED_BASE%\include\boost' -Destination '%PWIZ_DIR%\libraries\boost_1_86_0' -Recurse -Force" +) -:downloadfile -PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%1','%2')" EXIT /B diff --git a/admin/builders/nativew32_build.bat b/admin/builders/nativew32_build.bat index c66f2cc..b8a65d5 100644 --- a/admin/builders/nativew32_build.bat +++ b/admin/builders/nativew32_build.bat @@ -12,6 +12,7 @@ @echo off set SRC_DIR=%~dp0..\..\..\ +set SCRIPT_DIR=%~dp0 set BUILD_DIR=%SRC_DIR%\build\win32 set RELEASE_DIR=%SRC_DIR%\release\win32 set BUILD_TYPE=Release @@ -50,15 +51,15 @@ if not exist "%RELEASE_DIR%" (md "%RELEASE_DIR%") set ZIP_DIR=%INSTALL_DIR%\%ZIP_BASE% if not exist "%ZIP_DIR%" ( echo Downloading and installing 7-Zip - call :downloadfile %ZIP_URL% %INSTALL_DIR%\7zip.exe - "%INSTALL_DIR%\7zip.exe" /S /D=%INSTALL_DIR%\7zip + call %SCRIPT_DIR%\download_file.bat %ZIP_URL% %INSTALL_DIR%\7zip.exe + "%INSTALL_DIR%\7zip.exe" /S /D=%ZIP_DIR% ) set ZIP_EXE="%ZIP_DIR%\7z.exe" set CMAKE_DIR=%INSTALL_DIR%\%CMAKE_BASE% if not exist "%CMAKE_DIR%" ( echo Downloading and installing CMake - call :downloadfile %CMAKE_URL% %INSTALL_DIR%\cmake.zip + call %SCRIPT_DIR%\download_file.bat %CMAKE_URL% %INSTALL_DIR%\cmake.zip %ZIP_EXE% x "%INSTALL_DIR%\cmake.zip" -o"%INSTALL_DIR%" -aoa -xr!doc > NUL ) set CMAKE_EXE="%CMAKE_DIR%\bin\cmake.exe" @@ -70,11 +71,11 @@ if not "%NO_GUI%" == "true" ( if not exist "%INSTALL_DIR%\Qt-dynamic" ( ::: use multiple cores with jom instead of single-core nmake ::: echo Downloading Jom - call :downloadfile %JOM_URL% %INSTALL_DIR%\jom.zip + call %SCRIPT_DIR%\download_file.bat %JOM_URL% %INSTALL_DIR%\jom.zip %ZIP_EXE% x "%INSTALL_DIR%\jom.zip" -o"%INSTALL_DIR%\jom" -aoa > NUL echo Downloading Qt base - call :downloadfile %QT_URL% %INSTALL_DIR%\qt.zip + call %SCRIPT_DIR%\download_file.bat %QT_URL% %INSTALL_DIR%\qt.zip %ZIP_EXE% x "%INSTALL_DIR%\qt.zip" -o"%INSTALL_DIR%" -aoa > NUL cd /D "%QT_DIR%" @@ -97,7 +98,7 @@ if not "%NO_GUI%" == "true" ( set NSIS_DIR=%INSTALL_DIR%\nsis if not exist "%NSIS_DIR%" ( echo Downloading and installing NSIS installer - call :downloadfile "%NSIS_URL%" %INSTALL_DIR%\nsis.exe + call %SCRIPT_DIR%\download_file.bat "%NSIS_URL%" %INSTALL_DIR%\nsis.exe "%INSTALL_DIR%\nsis.exe" /S /D=%INSTALL_DIR%\nsis ) setlocal @@ -159,10 +160,6 @@ cd /D "%SRC_DIR%" EXIT /B %exit_code% -:downloadfile -echo Downloading %1 to %2 -PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%1','%2')" -EXIT /B :copytorelease echo Copying "%1" to "%RELEASE_DIR%" diff --git a/admin/builders/nativew64_build.bat b/admin/builders/nativew64_build.bat index 1332acc..90714d7 100644 --- a/admin/builders/nativew64_build.bat +++ b/admin/builders/nativew64_build.bat @@ -15,6 +15,7 @@ @echo off set SRC_DIR=%~dp0..\..\..\ +set SCRIPT_DIR=%~dp0 set BUILD_DIR=%SRC_DIR%\build\win64 set RELEASE_DIR=%SRC_DIR%\release\win64 set BUILD_TYPE=Release @@ -56,15 +57,15 @@ if not exist "%RELEASE_DIR%" (md "%RELEASE_DIR%") set ZIP_DIR=%INSTALL_DIR%\%ZIP_BASE% if not exist "%ZIP_DIR%" ( echo Downloading and installing 7-Zip - call :downloadfile %ZIP_URL% %INSTALL_DIR%\7zip.exe - "%INSTALL_DIR%\7zip.exe" /S /D=%INSTALL_DIR%\7zip + call %SCRIPT_DIR%\download_file.bat %ZIP_URL% %INSTALL_DIR%\7zip.exe + "%INSTALL_DIR%\7zip.exe" /S /D=%ZIP_DIR% ) set ZIP_EXE="%ZIP_DIR%\7z.exe" set CMAKE_DIR=%INSTALL_DIR%\%CMAKE_BASE% if not exist "%CMAKE_DIR%" ( echo Downloading and installing CMake - call :downloadfile %CMAKE_URL% %INSTALL_DIR%\cmake.zip + call %SCRIPT_DIR%\download_file.bat %CMAKE_URL% %INSTALL_DIR%\cmake.zip %ZIP_EXE% x "%INSTALL_DIR%\cmake.zip" -o"%INSTALL_DIR%" -aoa -xr!doc > NUL ) set CMAKE_EXE="%CMAKE_DIR%\bin\cmake.exe" @@ -76,11 +77,11 @@ if not "%NO_GUI%" == "true" ( if not exist "%INSTALL_DIR%\Qt-dynamic" ( ::: use multiple cores with jom instead of single-core nmake ::: echo Downloading Jom - call :downloadfile %JOM_URL% %INSTALL_DIR%\jom.zip + call %SCRIPT_DIR%\download_file.bat %JOM_URL% %INSTALL_DIR%\jom.zip %ZIP_EXE% x "%INSTALL_DIR%\jom.zip" -o"%INSTALL_DIR%\jom" -aoa > NUL echo Downloading Qt base - call :downloadfile %QT_URL% %INSTALL_DIR%\qt.zip + call %SCRIPT_DIR%\download_file.bat %QT_URL% %INSTALL_DIR%\qt.zip %ZIP_EXE% x "%INSTALL_DIR%\qt.zip" -o"%INSTALL_DIR%" -aoa > NUL cd /D "%QT_DIR%" @@ -103,7 +104,7 @@ if not "%NO_GUI%" == "true" ( set NSIS_DIR=%INSTALL_DIR%\nsis if not exist "%NSIS_DIR%" ( echo Downloading and installing NSIS installer - call :downloadfile "%NSIS_URL%" %INSTALL_DIR%\nsis.exe + call %SCRIPT_DIR%\download_file.bat "%NSIS_URL%" %INSTALL_DIR%\nsis.exe "%INSTALL_DIR%\nsis.exe" /S /D=%INSTALL_DIR%\nsis ) setlocal @@ -184,10 +185,6 @@ cd /D "%SRC_DIR%" EXIT /B %exit_code% -:downloadfile -echo Downloading %1 to %2 -PowerShell "[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'; (new-object System.Net.WebClient).DownloadFile('%1','%2')" -EXIT /B :copytorelease echo Copying "%1" to "%RELEASE_DIR%"