1 name: SimGrid complete jar file generation
3 on: [workflow_dispatch]
7 runs-on: ${{ matrix.config.os }}-latest
11 - { name: "Windows MingW", os: windows, cc: "gcc", cxx: "g++", generator: "MinGW Makefiles", cmake_extra_options: "-Denable_lto=OFF" }
12 - { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
13 - { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
15 - uses: actions/checkout@v2
16 # install dependencies
19 echo "::set-env name=CC::${{ matrix.config.cc }}"
20 echo "::set-env name=CXX::${{ matrix.config.cxx }}"
21 - name: Install boost on ubuntu
22 if: matrix.config.os == 'ubuntu'
23 run: sudo apt-get update && sudo apt-get install -yq libboost-dev
24 - name: Install boost on macos
25 if: matrix.config.os == 'macos'
26 run: brew install boost
27 - name: Install boost and gcc on windows
28 if: matrix.config.os == 'windows'
30 Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
31 scoop install gcc --global
32 echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_72_0"
33 echo "::set-env name=BOOST_INCLUDEDIR::$env:BOOST_ROOT\boost\include"
34 echo "::set-env name=BOOST_LIBRARYDIR::$env:BOOST_ROOT\lib"
35 - name: Build jar with Cmake
39 cmake -Denable_documentation=OFF -Denable_java=ON -Denable_msg=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF ${{ matrix.config.cmake_extra_options }} -G "${{ matrix.config.generator }}" ..
40 make -j2 simgrid-java_jar
42 uses: actions/upload-artifact@v2
44 name: jar-${{ matrix.config.os }}
45 path: build/simgrid.jar
49 runs-on: ubuntu-latest
51 - uses: actions/checkout@v2
52 - name: Download all jars from ubuntu
53 uses: actions/download-artifact@v2
54 - name: Build final jar
56 patch=$(grep -r set\(SIMGRID_VERSION_PATCH ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
57 major=$(grep -r set\(SIMGRID_VERSION_MAJOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
58 minor=$(grep -r set\(SIMGRID_VERSION_MINOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
59 if [ $patch -ne 0 ]; then
60 version="$major.$minor.$patch"
62 version="$major.$minor"
66 for j in ubuntu macos windows ; do unzip -n ../jar-$j/simgrid.jar ; done
68 x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
69 zip -r ../simgrid-${version}.jar *
71 uses: actions/upload-artifact@v2
75 - name: cleanup artifacts
76 uses: geekyeggo/delete-artifact@v1