opensim-application #3091
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: opensim-application | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| pull_request: | |
| branches: | |
| - '*' | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| jobs: | |
| windows: | |
| name: Windows | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout opensim-gui | |
| uses: actions/checkout@v4 | |
| - name: Install SWIG | |
| run: | | |
| choco install swig --version 4.1.1 --yes --limit-output --allow-downgrade | |
| swig -swiglib | |
| - name: Install Python packages | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install NumPy | |
| run: python3 -m pip install numpy==2.4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 11 | |
| - name: Cache Netbeans | |
| id: cache-netbeans | |
| uses: actions/cache@v3 | |
| with: | |
| path: .\Apache-NetBeans-17-bin-windows-x64.exe | |
| key: netbeans-17 | |
| - name: Install Netbeans 17 | |
| #if: steps.cache-netbeans.outputs.cache-hit != 'true' | |
| run: | | |
| (New-Object System.Net.WebClient).DownloadFile("https://archive.apache.org/dist/netbeans/netbeans-installers/17/Apache-NetBeans-17-bin-windows-x64.exe", "Apache-NetBeans-17-bin-windows-x64.exe") | |
| $expectedHash = "c3d7a34184c4021486751fbc3878eb2376677674ff8d6d4bf87017fd2434122c8438072aa891e535fa0fa9aeafcb49ad833a61903180772369d99571b073baac" | |
| $hashFromFile = Get-FileHash -Algorithm SHA512 -Path .\Apache-NetBeans-17-bin-windows-x64.exe | |
| if (($hashFromFile.Hash) -ne ($expectedHash)) { Write-Error "Hash doesn't match." } | |
| .\Apache-NetBeans-17-bin-windows-x64.exe --silent | Out-Null # This installer is gregarious. | |
| echo "ANT_HOME=C:\\Program Files\\NetBeans-17.0\\netbeans\\extide\\ant" >> $GITHUB_ENV | |
| - name: Checkout opensim-core main | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opensim-org/opensim-core | |
| path: 'opensim-core' | |
| - name: Cache opensim-core-dependencies | |
| id: cache-dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim_dependencies_install | |
| # Every time a cache is created, it's stored with this key. | |
| # In subsequent runs, if the key matches the key of an existing cache, | |
| # then the cache is used. We chose for this key to depend on the | |
| # operating system and a hash of the hashes of all files in the | |
| # dependencies directory (non-recursive). | |
| # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | |
| key: ${{ runner.os }}-dependencies-${{ hashFiles('opensim-core/dependencies/*') }} | |
| - name: Build opensim-core-dependencies | |
| if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
| run: | | |
| echo $env:GITHUB_WORKSPACE\\build_deps | |
| mkdir $env:GITHUB_WORKSPACE\\build_deps | |
| chdir $env:GITHUB_WORKSPACE\\build_deps | |
| # gci -r $env:GITHUB_WORKSPACE\\opensim-core | |
| # /W0 disables warnings. The other flags are copied from CMake's | |
| # default CMAKE_CXX_FLAGS. | |
| # https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx | |
| $env:CXXFLAGS = "/W0 /MD" | |
| cmake $env:GITHUB_WORKSPACE/opensim-core/dependencies -G"Visual Studio 17 2022" -A x64 -DSUPERBUILD_ezc3d:BOOL=on -DOPENSIM_WITH_CASADI:BOOL=on -DWIG_DIR=C:/ProgramData/chocolatey/lib/swig -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install | |
| cmake . -LAH | |
| cmake --build . --config Release -- /maxcpucount:2 | |
| - name: Obtain opensim-core commit | |
| id: opensim-core-commit | |
| run: | | |
| cd opensim-core | |
| $opensim_core_commit=(git rev-parse HEAD) | |
| echo "hash=$opensim_core_commit" >> $GITHUB_OUTPUT | |
| - name: Cache opensim-core | |
| id: cache-core | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim-core-install | |
| # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | |
| key: ${{ runner.os }}-${{ steps.opensim-core-commit.outputs.hash }} | |
| - name: Build opensim-core | |
| if: steps.cache-core.outputs.cache-hit != 'true' | |
| run: | | |
| echo $env:GITHUB_WORKSPACE\\build_core | |
| mkdir $env:GITHUB_WORKSPACE\\build_core | |
| chdir $env:GITHUB_WORKSPACE\\build_core | |
| $env:CXXFLAGS = "/W0 /MD" | |
| cmake $env:GITHUB_WORKSPACE/opensim-core -G"Visual Studio 17 2022" -A x64 -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DBUILD_JAVA_WRAPPING=on -DBUILD_PYTHON_WRAPPING=on -DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=off -DCMAKE_INSTALL_PREFIX=~/opensim-core-install | |
| cmake . -LAH | |
| cmake --build . --config Release -- /maxcpucount:2 | |
| cmake --install . | |
| - name: Update submodules | |
| run: git submodule update --init --recursive -- opensim-models opensim-visualizer Gui/opensim/opensim-viewer | |
| - name: Set CI to false | |
| run: echo "CI=false" >> $GITHUB_ENV | |
| - name: Download VC++ Redistributable | |
| shell: pwsh | |
| run: | | |
| $url = "https://aka.ms/vs/17/vc_redist.x64.exe" | |
| $dest = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.44.35112\vcredist_x64.exe" | |
| Invoke-WebRequest -Uri $url -OutFile $dest -UseBasicParsing | |
| echo "msvc.redist.exe=$dest" >> $env:GITHUB_ENV | |
| - name: Build GUI | |
| id: build-gui | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake ../ -G"Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=~/opensim-core-install -DANT_ARGS="-Dnbplatform.default.netbeans.dest.dir=C:/Program Files/NetBeans-17/netbeans;-Dnbplatform.default.harness.dir=C:/Program Files/NetBeans-17/netbeans/harness;-Dmsvc.redist.exe=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.44.35112\vcredist_x64.exe" | |
| cmake --build . --target CopyOpenSimCore --config Release | |
| cmake --build . --target CopyModels --config Release | |
| cmake --build . --target PrepareInstaller --config Release | |
| cmake --build . --target CopyJRE --config Release | |
| cmake --build . --target CopyVisualizer --config Release | |
| # Read the value of the cache variable storing the GUI build version. | |
| $env:match = cmake -L . | Select-String -Pattern OPENSIMGUI_BUILD_VERSION | |
| $VERSION = $env:match.split('=')[1] | |
| echo $VERSION | |
| echo "name=VERSION::$VERSION" >> $GITHUB_ENV | |
| echo "version=$VERSION" >> $env:GITHUB_OUTPUT | |
| - name: Add jxbrowser files to installer content | |
| run: | | |
| # Set root and directories | |
| $root = $env:GITHUB_WORKSPACE | |
| $nbmDir = "$root\prebuilt_jxb" | |
| $extractDir = "$nbmDir\extracted" | |
| $installerContentPath = "$root\Gui\opensim\dist\installer\opensim\opensim" | |
| # Create prebuilt directory | |
| New-Item -ItemType Directory -Force -Path $nbmDir | |
| # Download the NBM file | |
| Invoke-WebRequest -Uri "https://github.com/opensim-org/opensim-visualizer/releases/download/v4.6.0/org-opensim-javabrowser.nbm" ` | |
| -OutFile "$nbmDir\org-opensim-javabrowser.nbm" | |
| # Extract the NBM | |
| Expand-Archive -Path "$nbmDir\org-opensim-javabrowser.nbm" -DestinationPath $extractDir -Force | |
| # Create installer modules directory | |
| New-Item -ItemType Directory -Force -Path "$installerContentPath/modules/" | |
| New-Item -ItemType Directory -Force -Path "$installerContentPath/modules/ext/" | |
| # Copy the main JAR | |
| Write-Host "Copying org-opensim-javabrowser.jar to installer content..." | |
| Copy-Item -Path "$extractDir\netbeans\modules\org-opensim-javabrowser.jar" ` | |
| -Destination "$installerContentPath/modules/" -Force | |
| # Copy Windows-specific JARs with exact names | |
| Write-Host "Copying Windows JARs to installer content..." | |
| Copy-Item -Path "$extractDir\netbeans\modules\ext\jxbrowser-7.44.1.jar" ` | |
| -Destination "$installerContentPath/modules/ext/" -Force | |
| Copy-Item -Path "$extractDir\netbeans\modules\ext\jxbrowser-swing-7.44.1.jar" ` | |
| -Destination "$installerContentPath/modules/ext/" -Force | |
| Copy-Item -Path "$extractDir\netbeans\modules\ext\jxbrowser-win64-7.44.1.jar" ` | |
| -Destination "$installerContentPath/modules/ext/" -Force | |
| # Verify files copied | |
| Write-Host "JAR files now in installer content:" | |
| Get-ChildItem -Path "$installerContentPath" -Recurse -Filter "*.jar" | Select-Object FullName | |
| - name: Build GUI installer | |
| run: | | |
| cd Gui/opensim/dist/installer | |
| makensis.exe make_installer.nsi | |
| mv OpenSim-${{ steps.build-gui.outputs.version }}-win64.exe $env:GITHUB_WORKSPACE | |
| - name: Upload GUI installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSim-${{ steps.build-gui.outputs.version }}-win64 | |
| path: OpenSim-${{ steps.build-gui.outputs.version }}-win64.exe | |
| mac: | |
| name: Mac | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout opensim-gui | |
| uses: actions/checkout@v4 | |
| - name: Checkout opensim-core main | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opensim-org/opensim-core | |
| path: 'opensim-core' | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install packages | |
| run: | | |
| brew uninstall cmake | |
| brew install cmake pkgconfig autoconf libtool automake wget pcre doxygen llvm | |
| brew reinstall gcc | |
| pip3 install numpy==2.4 | |
| gfortran -v | |
| mkdir gfortran_version | |
| gfortran -v &> gfortran_version/gfortran_version.txt | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 8 | |
| # - name: Setup tmate session to debug the workflow through SSH. | |
| # uses: mxschmitt/action-tmate@v2 | |
| - name: Install NetBeans 17 | |
| # `brew cask install netbeans-java-se` requires sudo but brew won't allow sudo, | |
| # so we install NetBeans ourselves. | |
| # Note: Cask 'netbeans' gives version 11.2, while 'netbeans-java-se' gives 8.2. | |
| run: | | |
| # We remove JDKs newer than 8 to force the NetBeans installer to use JDK 8. | |
| # If using JDK 14, the NetBeans installer fails because it cannot find unpack200, | |
| # which was removed from the JDK. See: | |
| # https://netbeans.apache.org/download/nb113/nb113.html | |
| # "The installers will NOT run under JDK 14 because usage is made of the Pack200 | |
| # Tools and API, for packing and unpacking, which is removed in JDK 14, see JEP 367." | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/zulu-14.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/zulu-13.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/zulu-12.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/zulu-11.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk | |
| sudo rm -rf /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk | |
| sudo rm -rf Java_Temurin-Hotspot_jdk | |
| /usr/libexec/java_home -V | |
| export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) | |
| echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| echo $JAVA_HOME | |
| wget https://archive.apache.org/dist/netbeans/netbeans-installers/17/Apache-NetBeans-17-bin-macosx.dmg | |
| hdiutil attach Apache-NetBeans-17-bin-macosx.dmg | |
| sudo installer -pkg /Volumes/Apache\ NetBeans\ 17/Apache\ NetBeans\ 17.pkg -target / | |
| sudo -k | |
| - name: Cache opensim-core-dependencies | |
| id: cache-dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim_dependencies_install | |
| # Every time a cache is created, it's stored with this key. | |
| # In subsequent runs, if the key matches the key of an existing cache, | |
| # then the cache is used. We chose for this key to depend on the | |
| # operating system and a hash of the hashes of all files in the | |
| # dependencies directory (non-recursive). | |
| # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | |
| key: ${{ runner.os }}-dependencies-${{ hashFiles('opensim-core/dependencies/*') }} | |
| - name: Build opensim-core-dependencies | |
| if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir build_deps | |
| cd build_deps | |
| cmake ../opensim-core/dependencies -DSUPERBUILD_ezc3d:BOOL=on -DOPENSIM_WITH_CASADI:BOOL=on -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install -DCMAKE_BUILD_TYPE=Release | |
| cmake . -LAH | |
| cmake --build . --config Release | |
| - name: Obtain opensim-core commit | |
| id: opensim-core-commit | |
| run: | | |
| cd opensim-core | |
| opensim_core_commit=$(git rev-parse HEAD) | |
| echo "hash=$opensim_core_commit" >> $GITHUB_OUTPUT | |
| - name: Cache opensim-core | |
| id: cache-core | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim-core-install | |
| key: ${{ runner.os }}-${{ steps.opensim-core-commit.outputs.hash }} | |
| - name: Install SWIG | |
| if: steps.cache-swig.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir ~/swig-source && cd ~/swig-source | |
| wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz | |
| tar xzf v4.1.1.tar.gz && cd swig-4.1.1 | |
| sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache | |
| make && make -j4 install | |
| - name: Build opensim-core | |
| if: steps.cache-core.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir build_core | |
| cd build_core | |
| cmake ../opensim-core -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DSWIG_EXECUTABLE=~/swig/bin/swig -DBUILD_JAVA_WRAPPING=on -DBUILD_PYTHON_WRAPPING=on -DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=off -DCMAKE_INSTALL_PREFIX=~/opensim-core-install -DOPENSIM_INSTALL_UNIX_FHS=OFF -DOPENSIM_DISABLE_LOG_FILE=ON | |
| cmake . -LAH | |
| cmake --build . --config Release | |
| cmake --install . | |
| - name: Update submodules | |
| run: git submodule update --init --recursive -- opensim-models opensim-visualizer Gui/opensim/opensim-viewer | |
| - name: Build GUI | |
| id: build-gui | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake ../ -DCMAKE_PREFIX_PATH=~/opensim-core-install -DANT_ARGS="-Dnbplatform.default.netbeans.dest.dir=/Applications/NetBeans/Apache NetBeans 17.app/Contents/Resources/NetBeans/netbeans;-Dnbplatform.default.harness.dir=/Applications/NetBeans/Apache NetBeans 17.app/Contents/Resources/NetBeans/netbeans/harness" | |
| make CopyOpenSimCore | |
| make PrepareInstaller | |
| # Read the value of the cache variable storing the GUI build version. | |
| VERSION=`cmake -L . | grep OPENSIMGUI_BUILD_VERSION | cut -d "=" -f2` | |
| echo $VERSION | |
| echo "name=VERSION::$VERSION" >> $GITHUB_ENV | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Add jxbrowser files to installer content | |
| run: | | |
| # Set root and directories | |
| ROOT="$GITHUB_WORKSPACE" | |
| NBM_DIR="$ROOT/prebuilt_jxb" | |
| EXTRACT_DIR="$NBM_DIR/extracted" | |
| INSTALLER_CONTENT="$ROOT/Gui/opensim/dist/installer/opensim/opensim" | |
| # Create prebuilt directory | |
| mkdir -p "$NBM_DIR" | |
| # Download the NBM file | |
| curl -L "https://github.com/opensim-org/opensim-visualizer/releases/download/v4.6.0/org-opensim-javabrowser.nbm" \ | |
| -o "$NBM_DIR/org-opensim-javabrowser.nbm" | |
| # Extract the NBM (nbm is a zip) | |
| mkdir -p "$EXTRACT_DIR" | |
| unzip -o "$NBM_DIR/org-opensim-javabrowser.nbm" -d "$EXTRACT_DIR" | |
| # Create installer modules directories | |
| mkdir -p "$INSTALLER_CONTENT/modules/" | |
| mkdir -p "$INSTALLER_CONTENT/modules/ext/" | |
| # Copy the main JAR | |
| cp "$EXTRACT_DIR/netbeans/modules/org-opensim-javabrowser.jar" "$INSTALLER_CONTENT/modules/" | |
| # Copy macOS-specific JARs with exact names | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-swing-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-mac-arm-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| # Verify files copied | |
| echo "JAR files now in installer content:" | |
| find "$INSTALLER_CONTENT" -name "*.jar" | |
| - name: Build GUI installer | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| ls Gui/opensim/dist | |
| mv Gui/opensim/dist/OpenSim-${{ steps.build-gui.outputs.version }}.pkg $GITHUB_WORKSPACE | |
| - name: Upload GUI installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSim-${{ steps.build-gui.outputs.version }}-mac | |
| path: OpenSim-${{ steps.build-gui.outputs.version }}.pkg | |
| ubuntu: | |
| name: Ubuntu2404 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout opensim-gui | |
| uses: actions/checkout@v4 | |
| - name: Checkout opensim-core main | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opensim-org/opensim-core | |
| path: 'opensim-core' | |
| - name: Install Python packages | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install NumPy | |
| run: python3 -m pip install numpy==2.4 | |
| - name: Install packages | |
| run: sudo apt-get update && sudo apt-get install --yes liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen gfortran-11 | |
| - name: Install SWIG | |
| #if: steps.cache-swig.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir ~/swig-source && cd ~/swig-source | |
| wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz | |
| tar xzf v4.1.1.tar.gz && cd swig-4.1.1 | |
| sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache | |
| make && make -j4 install | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Download and Install Netbeans | |
| run: | | |
| wget -q https://archive.apache.org/dist/netbeans/netbeans/17/netbeans-17-bin.zip | |
| unzip -q netbeans-17-bin.zip -d $HOME | |
| - name: Cache opensim-core-dependencies | |
| id: cache-dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim_dependencies_install | |
| # Every time a cache is created, it's stored with this key. | |
| # In subsequent runs, if the key matches the key of an existing cache, | |
| # then the cache is used. We chose for this key to depend on the | |
| # operating system and a hash of the hashes of all files in the | |
| # dependencies directory (non-recursive). | |
| # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | |
| key: ${{ runner.os }}-dependencies-${{ hashFiles('opensim-core/dependencies/*') }} | |
| - name: Build opensim-core-dependencies | |
| if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir build_deps | |
| cd build_deps | |
| cmake ../opensim-core/dependencies -DSUPERBUILD_ezc3d:BOOL=on -DOPENSIM_WITH_CASADI:BOOL=on -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install | |
| cmake . -LAH | |
| cmake --build . --config Release | |
| - name: Obtain opensim-core commit | |
| id: opensim-core-commit | |
| run: | | |
| cd opensim-core | |
| opensim_core_commit=$(git rev-parse HEAD) | |
| echo "hash=$opensim_core_commit" >> $GITHUB_OUTPUT | |
| - name: Cache opensim-core | |
| id: cache-core | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/opensim-core-install | |
| key: ${{ runner.os }}-${{ steps.opensim-core-commit.outputs.hash }} | |
| - name: Build opensim-core | |
| if: steps.cache-core.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir build_core | |
| cd build_core | |
| cmake ../opensim-core -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DBUILD_JAVA_WRAPPING=on -DBUILD_PYTHON_WRAPPING=on -DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=off -DCMAKE_INSTALL_PREFIX=~/opensim-core-install -DOPENSIM_INSTALL_UNIX_FHS=OFF -DSWIG_DIR=~/swig/share/swig -DSWIG_EXECUTABLE=~/swig/bin/swig | |
| cmake . -LAH | |
| cmake --build . --config Release | |
| cmake --install . | |
| - name: Remove opensim-core and swig | |
| run: | | |
| rm -rf ~/swig-source | |
| rm -rf ~/work/opensim-gui/opensim-gui/build_core | |
| - name: Update submodules | |
| run: git submodule update --init --recursive -- opensim-models opensim-visualizer Gui/opensim/opensim-viewer | |
| - name: Build GUI | |
| id: build-gui | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake ../ -DCMAKE_PREFIX_PATH=~/opensim-core-install -DANT_ARGS="-Dnbplatform.default.netbeans.dest.dir=$HOME/netbeans;-Dnbplatform.default.harness.dir=$HOME/netbeans/harness" | |
| make CopyOpenSimCore | |
| make PrepareInstaller | |
| # Read the value of the cache variable storing the GUI build version. | |
| VERSION=`cmake -L . | grep OPENSIMGUI_BUILD_VERSION | cut -d "=" -f2` | |
| echo $VERSION | |
| echo "name=VERSION::$VERSION" >> $GITHUB_ENV | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Add jxbrowser files to installer content | |
| run: | | |
| # Set root and directories | |
| ROOT="$GITHUB_WORKSPACE" | |
| NBM_DIR="$ROOT/prebuilt_jxb" | |
| EXTRACT_DIR="$NBM_DIR/extracted" | |
| INSTALLER_CONTENT="$ROOT/Gui/opensim/dist/installer/opensim/opensim" | |
| # Create prebuilt directory | |
| mkdir -p "$NBM_DIR" | |
| # Download the NBM file pinned to version v4.6.0 | |
| wget -O "$NBM_DIR/org-opensim-javabrowser.nbm" \ | |
| "https://github.com/opensim-org/opensim-visualizer/releases/download/v4.6.0/org-opensim-javabrowser.nbm" | |
| # Extract the NBM (nbm is a zip) | |
| mkdir -p "$EXTRACT_DIR" | |
| unzip -o "$NBM_DIR/org-opensim-javabrowser.nbm" -d "$EXTRACT_DIR" | |
| # Create installer modules directories | |
| mkdir -p "$INSTALLER_CONTENT/modules/" | |
| mkdir -p "$INSTALLER_CONTENT/modules/ext/" | |
| # Copy the main JAR | |
| cp "$EXTRACT_DIR/netbeans/modules/org-opensim-javabrowser.jar" "$INSTALLER_CONTENT/modules/" | |
| # For Linux, copy all JARs with exact names | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-swing-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| cp "$EXTRACT_DIR/netbeans/modules/ext/jxbrowser-linux64-7.44.1.jar" "$INSTALLER_CONTENT/modules/ext/" | |
| # Verify files copied | |
| echo "JAR files now in installer content:" | |
| find "$INSTALLER_CONTENT" -name "*.jar" | |
| - name: Build GUI installer | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| ls Gui/opensim/dist/installer/opensim/opensim/modules | |
| ls Gui/opensim/dist/installer/opensim/opensim/modules/ext | |
| # mv Gui/opensim/dist/OpenSim-${{ steps.build-gui.outputs.version }}.tar.gz $GITHUB_WORKSPACE | |
| # create new zip file with updated contents | |
| cd Gui/opensim/dist/installer | |
| zip -r opensim.zip opensim | |
| mv opensim.zip $GITHUB_WORKSPACE | |
| - name: Upload GUI installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSim-${{ steps.build-gui.outputs.version }}-ub24-linux | |
| path: opensim.zip |