Skip to content

Commit

Permalink
build windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yoranjj committed Jan 13, 2025
1 parent 3477318 commit e22918a
Showing 1 changed file with 112 additions and 112 deletions.
224 changes: 112 additions & 112 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,103 +31,13 @@ on:
- "docker/**"

jobs:
# build-windows:
# name: Windows build
# runs-on: windows-2019

# strategy:
# matrix:
# arch: [Win32]

# steps:
# - uses: actions/checkout@v3
# with:
# clean: true
# submodules: recursive
# fetch-depth: 0

# - name: Declare build output variables
# id: vars
# shell: bash
# env:
# HEAD_REF: ${{ github.head_ref || github.ref_name }}
# run: |
# echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT
# echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT

# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'

# - name: Install CMake
# uses: lukka/get-cmake@latest
# with:
# cmakeVersion: "3.23.2"

# - name: Install latest conan
# run: |
# python -m pip install --upgrade pip
# pip install -v "conan==1.57.0"

# - name: Try to restore conan cache
# id: conan-cache-restore
# uses: actions/cache/restore@v3
# env:
# cache-name: cache-conan-modules
# with:
# path: ~/.conan/data
# key: conan-windows-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt', 'lib/CMakeLists.txt', 'SDK/CMakeLists.txt', 'SDK/lib/cmake-conan/conan.cmake', 'SDK/lib/cmake-conan/conan-omp.cmake') }}

# - name: Generate build files
# run: |
# $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines
# $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD)
# mkdir build
# cd build
# cmake -DCMAKE_BUILD_TYPE=${{ steps.vars.outputs.build_config }} .. -A ${{ matrix.arch }} -T "ClangCL"

# - name: Try to save conan cache
# if: steps.conan-cache-restore.outputs.cache-hit != 'true'
# uses: actions/cache/save@v3
# env:
# cache-name: cache-conan-modules
# with:
# path: ~/.conan/data
# key: ${{ steps.conan-cache-restore.outputs.cache-primary-key }}

# - name: Build
# run: |
# cd build
# cmake --build . --config ${{ steps.vars.outputs.build_config }}

# - name: Create a build archive
# id: build
# shell: bash
# env:
# HEAD_REF: ${{ github.head_ref || github.ref_name }}
# run: |
# version=${{ steps.vars.outputs.build_version }}
# artifact_name="open.mp-win-${{ matrix.arch }}-${version}"
# echo "artifact_name=${artifact_name}" >> $GITHUB_OUTPUT
# cd build/Output/*
# powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${artifact_name}.zip" -Path "Server"

# - name: Upload build artifacts
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.build.outputs.artifact_name }}
# path: build/Output/${{ steps.vars.outputs.build_config }}/${{ steps.build.outputs.artifact_name }}.zip
# if-no-files-found: error

build-linux:
name: Linux build
runs-on: ubuntu-latest
build-windows:
name: Windows build
runs-on: windows-2019

strategy:
matrix:
arch: [x86_64]
ssl: [static]
arch: [Win32]

steps:
- uses: actions/checkout@v3
Expand All @@ -144,58 +54,148 @@ jobs:
run: |
echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT
echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT
echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT
echo "build_shared=${{ matrix.ssl == 'dynamic' }}" >> $GITHUB_OUTPUT
echo "build_server=1" >> $GITHUB_OUTPUT
echo "build_tools=0" >> $GITHUB_OUTPUT
echo "build_target_arch=${{ matrix.arch }}" >> $GITHUB_OUTPUT
- name: Set ownership
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.23.2"

- name: Install latest conan
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
python -m pip install --upgrade pip
pip install -v "conan==1.57.0"
- name: Try to restore conan cache
id: conan-cache-restore
uses: actions/cache/restore@v3
env:
cache-name: cache-conan-modules
with:
path: docker/conan/data
key: conan-linux-${{ matrix.arch }}-${{ matrix.ssl }}-${{ hashFiles('CMakeLists.txt', 'lib/CMakeLists.txt', 'SDK/CMakeLists.txt', 'SDK/lib/cmake-conan/conan.cmake', 'SDK/lib/cmake-conan/conan-omp.cmake') }}
path: ~/.conan/data
key: conan-windows-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt', 'lib/CMakeLists.txt', 'SDK/CMakeLists.txt', 'SDK/lib/cmake-conan/conan.cmake', 'SDK/lib/cmake-conan/conan-omp.cmake') }}

- name: Build
- name: Generate build files
run: |
cd docker
CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} TARGET_BUILD_ARCH=${{ steps.vars.outputs.build_target_arch }} ./build.sh
$env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines
$env:OMP_BUILD_COMMIT=$(git rev-parse HEAD)
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ steps.vars.outputs.build_config }} .. -A ${{ matrix.arch }} -T "ClangCL"
- name: Try to save conan cache
if: steps.conan-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
env:
cache-name: cache-conan-modules
with:
path: docker/conan/data
path: ~/.conan/data
key: ${{ steps.conan-cache-restore.outputs.cache-primary-key }}

- name: Build
run: |
cd build
cmake --build . --config ${{ steps.vars.outputs.build_config }}
- name: Create a build archive
id: build
shell: bash
env:
HEAD_REF: ${{ github.head_ref || github.ref_name }}
run: |
version=${{ steps.vars.outputs.build_version }}
artifact_name="open.mp-linux-${{ matrix.arch }}${{ matrix.ssl == 'dynamic' && '-dynssl' || '' }}-${version}"
artifact_name="open.mp-win-${{ matrix.arch }}-${version}"
echo "artifact_name=${artifact_name}" >> $GITHUB_OUTPUT
cd docker/build/Output/*
sudo tar -cJvf "${artifact_name}.tar.xz" "Server"
cd build/Output/*
powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${artifact_name}.zip" -Path "Server"
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build.outputs.artifact_name }}
path: docker/build/Output/${{ steps.vars.outputs.build_config }}/${{ steps.build.outputs.artifact_name }}.tar.xz
path: build/Output/${{ steps.vars.outputs.build_config }}/${{ steps.build.outputs.artifact_name }}.zip
if-no-files-found: error

# build-linux:
# name: Linux build
# runs-on: ubuntu-latest

# strategy:
# matrix:
# arch: [x86_64]
# ssl: [static]

# steps:
# - uses: actions/checkout@v3
# with:
# clean: true
# submodules: recursive
# fetch-depth: 0

# - name: Declare build output variables
# id: vars
# shell: bash
# env:
# HEAD_REF: ${{ github.head_ref || github.ref_name }}
# run: |
# echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT
# echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT
# echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT
# echo "build_shared=${{ matrix.ssl == 'dynamic' }}" >> $GITHUB_OUTPUT
# echo "build_server=1" >> $GITHUB_OUTPUT
# echo "build_tools=0" >> $GITHUB_OUTPUT
# echo "build_target_arch=${{ matrix.arch }}" >> $GITHUB_OUTPUT

# - name: Set ownership
# run: |
# # this is to fix GIT not liking owner of the checkout dir
# chown -R $(id -u):$(id -g) $PWD

# - name: Try to restore conan cache
# id: conan-cache-restore
# uses: actions/cache/restore@v3
# env:
# cache-name: cache-conan-modules
# with:
# path: docker/conan/data
# key: conan-linux-${{ matrix.arch }}-${{ matrix.ssl }}-${{ hashFiles('CMakeLists.txt', 'lib/CMakeLists.txt', 'SDK/CMakeLists.txt', 'SDK/lib/cmake-conan/conan.cmake', 'SDK/lib/cmake-conan/conan-omp.cmake') }}

# - name: Build
# run: |
# cd docker
# CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} TARGET_BUILD_ARCH=${{ steps.vars.outputs.build_target_arch }} ./build.sh

# - name: Try to save conan cache
# if: steps.conan-cache-restore.outputs.cache-hit != 'true'
# uses: actions/cache/save@v3
# env:
# cache-name: cache-conan-modules
# with:
# path: docker/conan/data
# key: ${{ steps.conan-cache-restore.outputs.cache-primary-key }}

# - name: Create a build archive
# id: build
# env:
# HEAD_REF: ${{ github.head_ref || github.ref_name }}
# run: |
# version=${{ steps.vars.outputs.build_version }}
# artifact_name="open.mp-linux-${{ matrix.arch }}${{ matrix.ssl == 'dynamic' && '-dynssl' || '' }}-${version}"
# echo "artifact_name=${artifact_name}" >> $GITHUB_OUTPUT
# cd docker/build/Output/*
# sudo tar -cJvf "${artifact_name}.tar.xz" "Server"

# - name: Upload build artifacts
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.build.outputs.artifact_name }}
# path: docker/build/Output/${{ steps.vars.outputs.build_config }}/${{ steps.build.outputs.artifact_name }}.tar.xz
# if-no-files-found: error

# abi-check:
# if: github.event_name == 'pull_request'
# name: SDK ABI check
Expand Down

0 comments on commit e22918a

Please sign in to comment.