name: Build SOS on: workflow_dispatch: push: tags: - '*' jobs: build-mentos: runs-on: ubuntu-latest steps: - name: Checkout the sources uses: actions/checkout@v4 - name: Cache build dir id: mentos-cached-build uses: actions/cache@v4 with: path: MentOS/build key: 427067e-mentos-cached-build - name: Checkout MentOS submodule if: steps.mentos-cached-build.outputs.cache-hit != 'true' run: git submodule update --init MentOS - name: Install dependencies if: steps.mentos-cached-build.outputs.cache-hit != 'true' run: | sudo apt-get update sudo apt-get install -y nasm fuse2fs - name: Build if: steps.mentos-cached-build.outputs.cache-hit != 'true' run: | cd MentOS cmake -B build -DKEYMAP_TYPE=KEYMAP_DE cmake --build build --parallel 2 --target exercises filesystem_permissions bootloader.bin - name: Upload MentOS artifact uses: actions/upload-artifact@v4 with: name: MentOS path: MentOS/build build-qemu: runs-on: windows-latest defaults: run: shell: msys2 {0} steps: - name: Checkout the sources uses: actions/checkout@v4 - name: Cache build dir id: qemu-cached-build uses: actions/cache@v4 with: path: qemu/build key: v8.2.1-3-qemu-cached-build - name: Setup mingw build environment if: steps.qemu-cached-build.outputs.cache-hit != 'true' uses: msys2/setup-msys2@v2 with: update: true install: >- base-devel mingw-w64-x86_64-toolchain git python meson ninja mingw-w64-x86_64-glib2 mingw-w64-x86_64-pixman python-setuptools mingw-w64-x86_64-gtk3 - name: Checkout MentOS submodule if: steps.qemu-cached-build.outputs.cache-hit != 'true' run: git submodule update --init qemu - name: Create needed directories if: steps.qemu-cached-build.outputs.cache-hit != 'true' run: > mkdir qemu/build mkdir qemu-install - name: Configure QEMU build if: steps.qemu-cached-build.outputs.cache-hit != 'true' run: > cd qemu/build; ../configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=i386-softmmu --disable-werror --disable-stack-protector --disable-qom-cast-debug --enable-gtk --disable-sdl --disable-kvm --disable-dsound --disable-dbus-display --disable-guest-agent --disable-vnc --disable-tools --disable-bochs - name: Build QEMU run: cd qemu/build; make -j 2 all install if: steps.qemu-cached-build.outputs.cache-hit != 'true' - name: Copy required DLLs into the build directory if: steps.qemu-cached-build.outputs.cache-hit != 'true' run: > cp /mingw64/bin/libbz2-1.dll /mingw64/bin/liblzo2-2.dll /mingw64/bin/libcairo-2.dll /mingw64/bin/libcairo-gobject-2.dll /mingw64/bin/libwinpthread-1.dll /mingw64/bin/libepoxy-0.dll /mingw64/bin/libgdk-3-0.dll /mingw64/bin/libgdk_pixbuf-2.0-0.dll /mingw64/bin/libgio-2.0-0.dll /mingw64/bin/libglib-2.0-0.dll /mingw64/bin/libgmodule-2.0-0.dll /mingw64/bin/libgobject-2.0-0.dll /mingw64/bin/libgtk-3-0.dll /mingw64/bin/libiconv-2.dll /mingw64/bin/libintl-8.dll /mingw64/bin/libncursesw6.dll /mingw64/bin/libpixman-1-0.dll /mingw64/bin/libpng16-16.dll /mingw64/bin/zlib1.dll /mingw64/bin/libzstd.dll /mingw64/bin/libgcc_s_seh-1.dll /mingw64/bin/libstdc++-6.dll /mingw64/bin/libfontconfig-1.dll /mingw64/bin/libfreetype-6.dll /mingw64/bin/libfribidi-0.dll /mingw64/bin/libpango-1.0-0.dll /mingw64/bin/libpangocairo-1.0-0.dll /mingw64/bin/libpangowin32-1.0-0.dll /mingw64/bin/libpangoft2-1.0-0.dll /mingw64/bin/libffi-8.dll /mingw64/bin/libpcre2-8-0.dll /mingw64/bin/libharfbuzz-0.dll /mingw64/bin/libatk-1.0-0.dll /mingw64/bin/libexpat-1.dll /mingw64/bin/libbrotlidec.dll /mingw64/bin/libbrotlicommon.dll /mingw64/bin/libthai-0.dll /mingw64/bin/libgraphite2.dll /mingw64/bin/libdatrie-1.dll qemu-install - name: Upload qemu artifact uses: actions/upload-artifact@v4 with: name: qemu path: | qemu-install run.bat build-course: runs-on: ubuntu-latest steps: - name: Checkout the sources uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt update sudo apt install texlive-latex-extra texlive-lang-german - name: Install pandoc run: | wget https://github.com/jgm/pandoc/releases/download/3.1.11.1/pandoc-3.1.11.1-linux-amd64.tar.gz tar xf pandoc*.tar.gz sudo cp pandoc*/bin/pandoc /usr/bin - name: Install pandoc-plot run: | wget https://github.com/LaurentRDC/pandoc-plot/releases/download/1.7.0/pandoc-plot-Linux-x86_64-static.zip unzip pandoc-plot*.zip chmod a+rx pandoc-plot sudo cp pandoc-plot /usr/bin - name: Build course material run: | make -C course - name: Upload course artifact uses: actions/upload-artifact@v4 with: name: course path: course/build publish: runs-on: ubuntu-latest needs: - build-mentos - build-qemu - build-course permissions: contents: write steps: - name: Download artifacts uses: actions/download-artifact@v4 - name: Extract run.bat from qemu artifact run: mv qemu/run.bat . - name: Zip the windows release run: zip -r sos-win.zip run.bat qemu MentOS course - name: Release artifacts if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: files: sos-win.zip