2021-01-02 19:46:03 +00:00
|
|
|
name: Build using conan+cmake
|
2020-11-30 18:26:31 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
release:
|
|
|
|
types: published
|
|
|
|
jobs:
|
|
|
|
build-cmake:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
platform: ['null', 'gl3', 'd3d9', 'ps2']
|
2021-01-02 19:46:03 +00:00
|
|
|
gl3_gfxlib: ['glfw', 'sdl2']
|
2020-11-30 18:26:31 +00:00
|
|
|
exclude:
|
|
|
|
- os: windows-latest
|
|
|
|
platform: ps2
|
|
|
|
- os: ubuntu-latest
|
|
|
|
platform: d3d9
|
|
|
|
- os: macos-latest
|
|
|
|
platform: d3d9
|
2021-01-02 19:46:03 +00:00
|
|
|
- platform: 'null'
|
|
|
|
gl3_gfxlib: sdl2
|
|
|
|
- platform: d3d9
|
|
|
|
gl3_gfxlib: sdl2
|
|
|
|
- platform: ps2
|
|
|
|
gl3_gfxlib: sdl2
|
2020-11-30 18:26:31 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-01-02 19:46:03 +00:00
|
|
|
continue-on-error: ${{ matrix.platform == 'ps2' }}
|
2020-11-30 18:26:31 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
- name: "Setup conan"
|
|
|
|
run: |
|
|
|
|
python -m pip install conan
|
2021-01-02 19:46:03 +00:00
|
|
|
conan config init
|
2020-11-30 18:26:31 +00:00
|
|
|
conan config set log.print_run_commands=True
|
2021-01-02 19:46:03 +00:00
|
|
|
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
|
|
|
|
conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev
|
|
|
|
- name: "Add os=Playstation2 + gcc.version=3.2 to .conan/settings.yml"
|
|
|
|
if: ${{ matrix.platform == 'ps2' }}
|
|
|
|
shell: python
|
2020-11-30 18:26:31 +00:00
|
|
|
run: |
|
2021-01-02 19:46:03 +00:00
|
|
|
import os, yaml
|
|
|
|
settings_path = os.path.expanduser("~/.conan/settings.yml")
|
|
|
|
yml = yaml.safe_load(open(settings_path))
|
|
|
|
yml["os"]["Playstation2"] = None
|
|
|
|
yml["compiler"]["gcc"]["version"].append("3.2")
|
|
|
|
yml["compiler"]["gcc"]["version"].sort()
|
|
|
|
yaml.safe_dump(yml, open(settings_path, "w"))
|
|
|
|
- name: "Create host profile"
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if test "${{ matrix.platform }}" = "ps2"; then
|
|
|
|
cp conan/playstation2 host_profile
|
|
|
|
else
|
|
|
|
cp ~/.conan/profiles/default host_profile
|
|
|
|
fi
|
|
|
|
- name: "Export Playstation 2 CMake toolchain conan recipe"
|
|
|
|
run: |
|
|
|
|
conan export cmake/ps2toolchain ps2dev-cmaketoolchain/master@
|
|
|
|
- name: "Download/build dependencies (conan install)"
|
|
|
|
run: |
|
2021-06-17 22:44:07 +01:00
|
|
|
conan install ${{ github.workspace }} librw/master@ -if build -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib}} --build missing -pr:h ./host_profile -pr:b default
|
2020-11-30 18:26:31 +00:00
|
|
|
env:
|
|
|
|
CONAN_SYSREQUIRES_MODE: enabled
|
2021-01-02 19:46:03 +00:00
|
|
|
- name: "Build librw (conan build)"
|
2020-11-30 18:26:31 +00:00
|
|
|
run: |
|
|
|
|
conan build ${{ github.workspace }} -if build -bf build -pf package
|
2021-01-02 19:46:03 +00:00
|
|
|
- name: "Package librw (conan package)"
|
2020-11-30 18:26:31 +00:00
|
|
|
run: |
|
|
|
|
conan package ${{ github.workspace }} -if build -bf build -pf package
|
2021-01-02 19:46:03 +00:00
|
|
|
- name: "Create binary package (cpack)"
|
|
|
|
working-directory: ./build
|
|
|
|
run: |
|
|
|
|
cpack
|
|
|
|
- name: "Archive binary package (github artifacts)"
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: "${{ matrix.os }}-${{ matrix.platform }}"
|
|
|
|
path: build/*.tar.xz
|
|
|
|
if-no-files-found: error
|