From 480904bd187e63f1e7bf5f5806a0609f42b89e78 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:01:06 -0500 Subject: [PATCH 1/6] Add GitHub Actions workflow to build platform-specific installers --- .github/workflows/build-installers.yml | 124 +++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/build-installers.yml diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml new file mode 100644 index 000000000..17c112792 --- /dev/null +++ b/.github/workflows/build-installers.yml @@ -0,0 +1,124 @@ +name: Build Installers + +on: + workflow_dispatch: + push: + branches: + - master + - develop + - '3.11.0' + pull_request: + +env: + OPENSTUDIO_VERSION: 3.11.0 + OPENSTUDIO_VERSION_SHA: 241b8abb4d + OPENSTUDIO_VERSION_EXT: "" + +jobs: + build-linux: + runs-on: ubuntu-24.04 + steps: + - name: Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup + shell: bash + run: ./ci/github-actions/setup.sh + env: + BUILD_TYPE: build + - name: Build Gem Package + shell: bash + run: ./ci/github-actions/export_build_linux.sh + - name: Upload Linux Artifact + uses: actions/upload-artifact@v4 + with: + name: openstudio-server-gems-linux + path: build/NREL/export/*.tar.gz + + build-macos: + runs-on: macos-15-intel # Matching the test workflow + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup + shell: bash + run: ./ci/github-actions/setup.sh + env: + BUILD_TYPE: build + - name: Build Gem Package + shell: bash + run: ./ci/github-actions/export_build_osx.sh + - name: Upload macOS Artifact + uses: actions/upload-artifact@v4 + with: + name: openstudio-server-gems-darwin + path: build/NREL/export/*.tar.gz + + build-windows: + runs-on: windows-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2.2' + bundler-cache: false # We manage gems manually via openstudio_meta + + - name: Download and Install OpenStudio + shell: powershell + run: | + $Version = "${{ env.OPENSTUDIO_VERSION }}" + $Ext = "${{ env.OPENSTUDIO_VERSION_EXT }}" + $Sha = "${{ env.OPENSTUDIO_VERSION_SHA }}" + $InstallerName = "OpenStudio-$Version$Ext+$Sha-Windows.exe" + $Url = "https://github.com/NREL/OpenStudio/releases/download/v$Version$Ext/$InstallerName" + + Write-Host "Downloading $Url..." + Invoke-WebRequest -Uri $Url -OutFile $InstallerName + + Write-Host "Installing OpenStudio..." + Start-Process -FilePath ".\$InstallerName" -ArgumentList "/S /D=C:\projects\openstudio" -Wait + + # Verify + $env:Path = "C:\projects\openstudio\bin;$env:Path" + openstudio openstudio_version + + - name: Setup MSYS2 and Dependencies + shell: cmd + run: | + ridk install 2 3 + + REM Mimic setup.cmd gcc installation if needed, but standard ruby setup usually suffices. + REM Checking gcc version + gcc --version + + - name: Build Gem Package + shell: cmd + env: + BUNDLE_VERSION: 2.4.10 + GEM_HOME: C:\projects\openstudio-server\gems + GEM_PATH: C:\projects\openstudio-server\gems;C:\projects\openstudio-server\gems\bundler\gems + RUBYLIB: C:\projects\openstudio\Ruby + OPENSTUDIO_TEST_EXE: C:\projects\openstudio\bin\openstudio.exe + run: | + REM Create export directory + mkdir C:\export + + REM Install Bundler + gem install bundler -v %BUNDLE_VERSION% --no-document + + REM Run Build + ruby bin\openstudio_meta install_gems --export="C:\export" --debug + + REM Move export to workspace for upload + mkdir build\NREL + move C:\export build\NREL\export + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v4 + with: + name: openstudio-server-gems-win32 + path: build/NREL/export/*.tar.gz From 969ec7e8d46a69ff3686568f627f5faedafd09c0 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:01:22 -0500 Subject: [PATCH 2/6] Update openstudio_meta to use modern bundler config syntax --- bin/openstudio_meta | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/openstudio_meta b/bin/openstudio_meta index 485f4eeef..9f46241e3 100755 --- a/bin/openstudio_meta +++ b/bin/openstudio_meta @@ -334,9 +334,11 @@ class InstallGems sys_cmds << "#{$ruby_path} #{bundler_bin} config build.libxml-ruby --use-system-libraries --with-xml2-config=/usr/bin/xml2-config" end if options[:test_dev_build] - sys_cmds << "#{$ruby_path} #{bundler_bin} install --retry=3 --jobs=1 --with default development test" + sys_cmds << "#{$ruby_path} #{bundler_bin} config set --local with 'default development test'" + sys_cmds << "#{$ruby_path} #{bundler_bin} install --retry=3 --jobs=1" else - sys_cmds << "#{$ruby_path} #{bundler_bin} install --retry=3 --jobs=1 --without development test" + sys_cmds << "#{$ruby_path} #{bundler_bin} config set --local without 'development test'" + sys_cmds << "#{$ruby_path} #{bundler_bin} install --retry=3 --jobs=1" end sys_cmds << "#{$ruby_path} #{bundler_bin} update" #unless Gem.win_platform? From ef9b64c511cf6be31b860f32594f4698a13add3c Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:05:35 -0500 Subject: [PATCH 3/6] Add manual inputs to build-installers workflow --- .github/workflows/build-installers.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index 17c112792..38113dd5e 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -2,17 +2,29 @@ name: Build Installers on: workflow_dispatch: + inputs: + openstudio_version: + description: 'OpenStudio Version (e.g. 3.11.0)' + required: true + default: '3.11.0' + openstudio_version_sha: + description: 'OpenStudio Version SHA (e.g. 241b8abb4d)' + required: true + default: '241b8abb4d' + openstudio_version_ext: + description: 'OpenStudio Version Extension (e.g. -rc1)' + required: false + default: '' push: branches: - master - develop - - '3.11.0' pull_request: env: - OPENSTUDIO_VERSION: 3.11.0 - OPENSTUDIO_VERSION_SHA: 241b8abb4d - OPENSTUDIO_VERSION_EXT: "" + OPENSTUDIO_VERSION: ${{ inputs.openstudio_version || '3.11.0' }} + OPENSTUDIO_VERSION_SHA: ${{ inputs.openstudio_version_sha || '241b8abb4d' }} + OPENSTUDIO_VERSION_EXT: ${{ inputs.openstudio_version_ext || '' }} jobs: build-linux: From 5934166bffbda596ed57e614bba7f25666e1ac4e Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:09:57 -0500 Subject: [PATCH 4/6] Add macOS ARM build job to workflow --- .github/workflows/build-installers.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index 38113dd5e..bf9df7b6b 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -67,6 +67,25 @@ jobs: name: openstudio-server-gems-darwin path: build/NREL/export/*.tar.gz + build-macos-arm: + runs-on: macos-15 + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup + shell: bash + run: ./ci/github-actions/setup.sh + env: + BUILD_TYPE: build + - name: Build Gem Package + shell: bash + run: ./ci/github-actions/export_build_osx.sh + - name: Upload macOS ARM Artifact + uses: actions/upload-artifact@v4 + with: + name: openstudio-server-gems-darwin-arm + path: build/NREL/export/*.tar.gz + build-windows: runs-on: windows-latest steps: From 298b9e1e5416741aa7516533ba65abb8a66e60d4 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:12:20 -0500 Subject: [PATCH 5/6] Refactor Windows build to use batch scripts --- .github/workflows/build-installers.yml | 42 ++------------------------ ci/github-actions/export_build_win.bat | 20 ++++++++++++ ci/github-actions/setup_win.bat | 39 ++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 39 deletions(-) create mode 100644 ci/github-actions/export_build_win.bat create mode 100644 ci/github-actions/setup_win.bat diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index bf9df7b6b..f6aef83f3 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -98,33 +98,9 @@ jobs: ruby-version: '3.2.2' bundler-cache: false # We manage gems manually via openstudio_meta - - name: Download and Install OpenStudio - shell: powershell - run: | - $Version = "${{ env.OPENSTUDIO_VERSION }}" - $Ext = "${{ env.OPENSTUDIO_VERSION_EXT }}" - $Sha = "${{ env.OPENSTUDIO_VERSION_SHA }}" - $InstallerName = "OpenStudio-$Version$Ext+$Sha-Windows.exe" - $Url = "https://github.com/NREL/OpenStudio/releases/download/v$Version$Ext/$InstallerName" - - Write-Host "Downloading $Url..." - Invoke-WebRequest -Uri $Url -OutFile $InstallerName - - Write-Host "Installing OpenStudio..." - Start-Process -FilePath ".\$InstallerName" -ArgumentList "/S /D=C:\projects\openstudio" -Wait - - # Verify - $env:Path = "C:\projects\openstudio\bin;$env:Path" - openstudio openstudio_version - - - name: Setup MSYS2 and Dependencies + - name: Setup Windows Environment shell: cmd - run: | - ridk install 2 3 - - REM Mimic setup.cmd gcc installation if needed, but standard ruby setup usually suffices. - REM Checking gcc version - gcc --version + run: ci\github-actions\setup_win.bat - name: Build Gem Package shell: cmd @@ -134,19 +110,7 @@ jobs: GEM_PATH: C:\projects\openstudio-server\gems;C:\projects\openstudio-server\gems\bundler\gems RUBYLIB: C:\projects\openstudio\Ruby OPENSTUDIO_TEST_EXE: C:\projects\openstudio\bin\openstudio.exe - run: | - REM Create export directory - mkdir C:\export - - REM Install Bundler - gem install bundler -v %BUNDLE_VERSION% --no-document - - REM Run Build - ruby bin\openstudio_meta install_gems --export="C:\export" --debug - - REM Move export to workspace for upload - mkdir build\NREL - move C:\export build\NREL\export + run: ci\github-actions\export_build_win.bat - name: Upload Windows Artifact uses: actions/upload-artifact@v4 diff --git a/ci/github-actions/export_build_win.bat b/ci/github-actions/export_build_win.bat new file mode 100644 index 000000000..ffd0ee9b8 --- /dev/null +++ b/ci/github-actions/export_build_win.bat @@ -0,0 +1,20 @@ +@echo off +setlocal + +REM Create export directory +if not exist "C:\export" mkdir C:\export + +REM Install Bundler +call gem install bundler -v %BUNDLE_VERSION% --no-document +if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + +REM Run Build +call ruby bin\openstudio_meta install_gems --export="C:\export" --debug +if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + +REM Move export to workspace for upload +if not exist "build\NREL" mkdir build\NREL +move C:\export build\NREL\export +if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + +endlocal diff --git a/ci/github-actions/setup_win.bat b/ci/github-actions/setup_win.bat new file mode 100644 index 000000000..8d69ca604 --- /dev/null +++ b/ci/github-actions/setup_win.bat @@ -0,0 +1,39 @@ +@echo off +setlocal + +REM --- Install OpenStudio --- +set "InstallerName=OpenStudio-%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%+%OPENSTUDIO_VERSION_SHA%-Windows.exe" +set "Url=https://github.com/NREL/OpenStudio/releases/download/v%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%/%InstallerName%" + +echo Downloading %Url%... +powershell -Command "Invoke-WebRequest -Uri '%Url%' -OutFile '%InstallerName%'" +if %ERRORLEVEL% neq 0 ( + echo Error downloading OpenStudio + exit /b %ERRORLEVEL% +) + +echo Installing OpenStudio... +start /wait "" ".\%InstallerName%" /S /D=C:\projects\openstudio +if %ERRORLEVEL% neq 0 ( + echo Error installing OpenStudio + exit /b %ERRORLEVEL% +) + +REM Verify OpenStudio +set "PATH=C:\projects\openstudio\bin;%PATH%" +call openstudio openstudio_version +if %ERRORLEVEL% neq 0 ( + echo Error verifying OpenStudio + exit /b %ERRORLEVEL% +) + +REM --- Setup MSYS2 and Dependencies --- +call ridk install 2 3 +if %ERRORLEVEL% neq 0 ( + echo Error running ridk install + exit /b %ERRORLEVEL% +) + +call gcc --version + +endlocal From f7c0b83ce7f1a8fd680a9d112a73d8fddf6bb3a2 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Fri, 16 Jan 2026 15:26:29 -0500 Subject: [PATCH 6/6] Update build scripts for improved error messaging and version tagging --- .github/workflows/build-installers.yml | 2 +- ci/github-actions/setup_win.bat | 12 ++++++++---- .../scripts/deploy_docker_github_actions.sh | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index f6aef83f3..22ee3b52a 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -49,7 +49,7 @@ jobs: path: build/NREL/export/*.tar.gz build-macos: - runs-on: macos-15-intel # Matching the test workflow + runs-on: macos-15-intel # Intel runner required for x86_64 architecture compatibility with OpenStudio (matching the test workflow) steps: - name: Check out repository uses: actions/checkout@v4 diff --git a/ci/github-actions/setup_win.bat b/ci/github-actions/setup_win.bat index 8d69ca604..2eaefed59 100644 --- a/ci/github-actions/setup_win.bat +++ b/ci/github-actions/setup_win.bat @@ -8,14 +8,14 @@ set "Url=https://github.com/NREL/OpenStudio/releases/download/v%OPENSTUDIO_VERSI echo Downloading %Url%... powershell -Command "Invoke-WebRequest -Uri '%Url%' -OutFile '%InstallerName%'" if %ERRORLEVEL% neq 0 ( - echo Error downloading OpenStudio + echo Failed to download OpenStudio from %Url% (exit code %ERRORLEVEL%) exit /b %ERRORLEVEL% ) echo Installing OpenStudio... start /wait "" ".\%InstallerName%" /S /D=C:\projects\openstudio if %ERRORLEVEL% neq 0 ( - echo Error installing OpenStudio + echo Failed to install OpenStudio from "%InstallerName%" (exit code %ERRORLEVEL%) exit /b %ERRORLEVEL% ) @@ -23,17 +23,21 @@ REM Verify OpenStudio set "PATH=C:\projects\openstudio\bin;%PATH%" call openstudio openstudio_version if %ERRORLEVEL% neq 0 ( - echo Error verifying OpenStudio + echo Failed to verify OpenStudio installation - 'openstudio openstudio_version' command failed (exit code %ERRORLEVEL%) exit /b %ERRORLEVEL% ) REM --- Setup MSYS2 and Dependencies --- call ridk install 2 3 if %ERRORLEVEL% neq 0 ( - echo Error running ridk install + echo Failed to install MSYS2 dependencies via ridk (exit code %ERRORLEVEL%) exit /b %ERRORLEVEL% ) call gcc --version +if %ERRORLEVEL% neq 0 ( + echo Error: gcc not found + exit /b %ERRORLEVEL% +) endlocal diff --git a/docker/deployment/scripts/deploy_docker_github_actions.sh b/docker/deployment/scripts/deploy_docker_github_actions.sh index 668bd88cb..f3db36444 100755 --- a/docker/deployment/scripts/deploy_docker_github_actions.sh +++ b/docker/deployment/scripts/deploy_docker_github_actions.sh @@ -15,7 +15,7 @@ elif [ "${GITHUB_REF}" == "refs/heads/master" ]; then elif [ "${GITHUB_REF}" == "refs/heads/setup_github_actions" ]; then IMAGETAG=experimental elif [ "${GITHUB_REF}" == "refs/heads/3.11.0" ]; then - IMAGETAG="3.11.0-rc2" + IMAGETAG="3.11.0" fi if [ "${IMAGETAG}" != "skip" ]; then