From 94bf4a74625ff2e40634ac487e37d8f33cd9d1c0 Mon Sep 17 00:00:00 2001 From: em-eight Date: Sat, 16 Sep 2023 19:29:45 +0300 Subject: [PATCH] Split workflow files in two --- .github/workflows/linux.yml | 34 ++++++++++++++++++++ .github/workflows/{build.yml => windows.yml} | 17 +++++----- 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/linux.yml rename .github/workflows/{build.yml => windows.yml} (69%) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..a862910 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,34 @@ +# Build and push artifacts +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install protobuf + run: sudo apt-get install -y protobuf-compiler + - name: CMake generate + env: + ARTIFACT_NAME: ppc2cpp-${{ runner.os }} + run: | + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF \ + shell: bash + - name: Build + run: cmake --build build --target install -j + + - uses: actions/upload-artifact@v3 + if: github.ref == 'refs/heads/main' && github.repository == 'em-eight/ppc2cpp' + with: + name: ppc2cpp-${{ runner.os }} + path: ppc2cpp-${{ runner.os }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/windows.yml similarity index 69% rename from .github/workflows/build.yml rename to .github/workflows/windows.yml index 590c533..fa64808 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/windows.yml @@ -9,19 +9,16 @@ on: jobs: build-and-push: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: Install protobuf - if: matrix.os == 'ubuntu-latest' - run: sudo apt-get install -y protobuf-compiler + - name: Install LLVM + run: choco install -y llvm + if: runner.os == 'Windows' + - name: windows vcpkg shit # https://vcpkg.io/en/getting-started.html - if: matrix.os == 'windows-latest' run: | git clone https://github.com/Microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh @@ -31,13 +28,15 @@ jobs: - name: CMake generate env: ARTIFACT_NAME: ppc2cpp-${{ runner.os }} - WINDOWS_FLAGS: ${{ matrix.os == 'windows-latest' && '-S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_GENERATOR_PLATFORM=x64' || '' }} + WINDOWS_FLAGS: -S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_GENERATOR_PLATFORM=x64 run: | echo $WINDOWS_FLAGS + cmake --version cmake -B build \ -DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFF \ + -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang $WINDOWS_FLAGS shell: bash - name: Build