From c9bbbaae0b5b84294b8ea73901101b0d902ed976 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Sun, 21 Jan 2024 23:10:06 +0400 Subject: [PATCH] ci: building job was universialised for using same code on both OS --- .github/workflows/nightly-builds.yml | 79 ++++++---------------------- 1 file changed, 15 insertions(+), 64 deletions(-) diff --git a/.github/workflows/nightly-builds.yml b/.github/workflows/nightly-builds.yml index 31dd47e2e..e633a3752 100644 --- a/.github/workflows/nightly-builds.yml +++ b/.github/workflows/nightly-builds.yml @@ -8,7 +8,7 @@ on: - 'documentation/**' jobs: - build-windows: + build: runs-on: ${{ matrix.os }} strategy: matrix: @@ -21,7 +21,10 @@ jobs: cmake_preset: windows-x64-debug build_conf: Debug devenv_arch: amd64 - + - os: ubuntu-22.04 + cmake_preset: linux-x64-debug + build_conf: Debug + devenv_arch: none steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,9 +38,17 @@ jobs: run: cmake -E make_directory ${{ github.workspace }}/build - uses: ilammy/msvc-dev-cmd@v1.12.1 + if: runner.os == 'Windows' with: arch: ${{ matrix.devenv_arch }} + - name: Install Linux-specific dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install gcc-multilib g++-multilib cmake + sudo apt-get install qtbase5-dev + - name: Install ninja-build tool uses: seanmiddleditch/gha-setup-ninja@v4 @@ -60,68 +71,8 @@ jobs: mkdir -p publish/primext/bin mkdir -p publish/primext/devkit cp -r build/${{ matrix.build_conf }}/primext/* publish/primext/ - cp build/${{ matrix.build_conf }}/primext_run publish/ - cp -r game_dir/* publish/primext - pushd publish - zip -r ../artifacts/primext-${{ matrix.cmake_preset }}.zip ./* - popd - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: artifact-${{ matrix.cmake_preset }} - path: artifacts/* - - build-linux: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-22.04 - cmake_preset: linux-x64-debug - build_conf: Debug - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - name: Create build environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{ github.workspace }}/build - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install gcc-multilib g++-multilib cmake ninja-build - sudo apt-get install qtbase5-dev - - - name: Configure CMake - # Use a bash shell so we can use the same syntax for environment variable - # access regardless of the host operating system - shell: bash - working-directory: ${{ github.workspace }}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE --preset ${{ matrix.cmake_preset }} - - - name: Build - working-directory: ${{ github.workspace }}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config ${{ matrix.build_conf }} --parallel 8 - - - name: Prepare artifacts - run: | - mkdir artifacts/ - mkdir -p publish/primext/bin - mkdir -p publish/primext/devkit - cp -r build/${{ matrix.build_conf }}/primext/* publish/primext/ - cp build/${{ matrix.build_conf }}/primext_run publish/ + cp build/${{ matrix.build_conf }}/primext_run publish/ || true + cp build/${{ matrix.build_conf }}/primext.exe publish/ || true cp -r game_dir/* publish/primext pushd publish zip -r ../artifacts/primext-${{ matrix.cmake_preset }}.zip ./*