Skip to content

build: use conan

build: use conan #72

Workflow file for this run

name: C/C++ CI
on:
push:
pull_request:
jobs:
job_build_cpp:
name: win
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
# Setup MSVC
- uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2022
toolset: 14
- uses: lukka/get-cmake@latest
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Print conan version
run: echo "${{ steps.conan.outputs.version }}"
- name: cache ~/.conan2
id: cache-conan
uses: actions/cache@v2
env:
cache-name: cache-conan-modules
with:
path: ~/.conan2/
key: ${{ runner.os }}-builder-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }}
restore-keys: ${{ runner.os }}-builder-${{ env.cache-name }}-
- name: Conan install
run: conan install . -s build_type=Release --output-folder=build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja --profile:host=./ci-conan-profile --profile:build=./ci-conan-profile
- name: Create build dir
run: mkdir build/ninja-release-win
- name: Run CMake
run: |
cmake --preset ninja-release-win
cmake --build --preset ninja-msvc-release
# Build the mod
- uses: gruppe-adler/action-release-with-hemtt@v3
name: 'Build Mod with HEMTT'
id: build
# Upload the mod
- uses: actions/upload-artifact@v1
with:
name: ${{ steps.build.outputs.mod_name }}
path: ${{ steps.build.outputs.release_path }}
# zip it
- uses: papeloto/action-zip@v1
with:
files: ${{ steps.build.outputs.release_path }}
dest: \@${{ steps.build.outputs.mod_name }}.zip
# release it
- uses: "marvinpinto/action-automatic-releases@latest"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: |
\@${{ steps.build.outputs.mod_name }}.zip