Skip to content

Commit

Permalink
Split workflow files in two
Browse files Browse the repository at this point in the history
  • Loading branch information
em-eight committed Sep 16, 2023
1 parent 1f020e2 commit 94bf4a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 8 additions & 9 deletions .github/workflows/build.yml → .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 94bf4a7

Please sign in to comment.