Skip to content
This repository was archived by the owner on May 1, 2026. It is now read-only.

Commit 78f393c

Browse files
committed
add conan to dev build workflow
1 parent 8118b32 commit 78f393c

4 files changed

Lines changed: 71 additions & 37 deletions

File tree

.github/workflows/build-develop.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,65 @@
11
name: Build Plugin Dev Release
22

3-
on:
4-
push:
5-
branches:
6-
- "develop"
3+
on: push
74

85
env:
96
DLL_NAME: vACDM.dll
107
BUILD_CONFIGURATION: Release
118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129
VERSION: "0"
1310
DEV_RELEASE: "-1"
11+
WORKSPACE: ${{ github.workspace }}
12+
WORKSPACE_BUILD: ${{ github.workspace }}/build
1413

1514
jobs:
1615
formatting-check:
1716
uses: ./.github/workflows/clang-format.yml
1817

19-
build:
18+
get-latest-version:
2019
needs: formatting-check
20+
uses: ./.github/workflows/get-latest-version.yml
21+
22+
build:
23+
needs: get-latest-version
2124
runs-on: windows-latest
2225
name: "Build plugin"
2326

2427
steps:
25-
- uses: actions/checkout@v3
26-
27-
- name: Set up Python
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: "3.x"
28+
- name: Check out repository
29+
uses: actions/checkout@v3
3130

32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install PyGithub
31+
# - name: Install MSVC toolset
32+
# run: choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
3633

37-
- name: Run version handler
38-
env:
39-
REPOSITORY: ${{ github.repository }}
40-
REF: ${{ github.ref }}
41-
run: |
42-
python .github/workflows/version_handler.py
34+
# - name: Set up MSVC environment
35+
# shell: pwsh
36+
# run: |
37+
# Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
38+
# Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
4339

44-
- name: Determine DEV_RELEASE value
45-
id: find_latest_dev_release
46-
env:
47-
REPOSITORY: ${{ github.repository }}
48-
run: python .github/workflows/determine_dev_release.py
40+
- name: Install Conan
41+
id: conan
42+
uses: turtlebrowser/get-conan@main
4943

50-
- name: Install MSVC toolset
51-
run: choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
44+
- name: Cache Conan packages
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.conan2
48+
key: ${{ runner.os }}-conan-${{ hashFiles('**/conanfile*') }}-build_type-${{ env.BUILD_CONFIGURATION }}
49+
restore-keys: |
50+
${{ runner.os }}-conan-${{ hashFiles('**/conanfile*') }}-
51+
${{ runner.os }}-conan-
5252
53-
- name: Set up MSVC environment
54-
shell: pwsh
53+
- name: Install Conan packages
5554
run: |
56-
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
57-
Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
55+
conan profile detect
56+
conan install . --profile=conanprofile --settings=build_type=${{ env.BUILD_CONFIGURATION }} --output-folder=${{env.WORKSPACE_BUILD}} --build=missing
5857
59-
- name: Configure CMake
60-
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_CONFIGURATION}} -A Win32 -DDEV_BUILD=ON -DDEV_RELEASE_NUMBER="${{ env.DEV_RELEASE }}"
58+
- name: CMake Setup
59+
run: cd ${{env.WORKSPACE_BUILD}} && cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=${{env.WORKSPACE_BUILD}}/conan_toolchain.cmake -A Win32
6160

6261
- name: Build DLL
63-
run: cmake --build build --config ${{env.BUILD_CONFIGURATION}}
62+
run: cmake --build ${{env.WORKSPACE_BUILD}} --config ${{env.BUILD_CONFIGURATION}}
6463

6564
- name: Create GitHub Release
6665
id: create_release
@@ -78,7 +77,7 @@ jobs:
7877
uses: actions/upload-release-asset@v1
7978
with:
8079
upload_url: ${{ steps.create_release.outputs.upload_url }}
81-
asset_path: build/${{env.BUILD_CONFIGURATION}}/${{env.DLL_NAME}}
80+
asset_path: ${{env.WORKSPACE_BUILD}}/${{env.BUILD_CONFIGURATION}}/${{env.DLL_NAME}}
8281
asset_name: ${{env.DLL_NAME}}
8382
asset_content_type: application/octet-stream
8483
env:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Latest Version Check
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
get-version:
8+
runs-on: windows-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.x"
16+
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install PyGithub
21+
22+
- name: Run version handler
23+
env:
24+
REPOSITORY: ${{ github.repository }}
25+
REF: ${{ github.ref }}
26+
run: |
27+
python .github/workflows/version_handler.py

.github/workflows/version_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
version = extract_version_from_cmakelists()
2222

23-
is_dev_branch = branch_name == "develop"
23+
is_dev_branch = branch_name != "main"
2424
dev_release = None
2525
if is_dev_branch:
2626
last_dev_release = determine_dev_release(version, REPOSITORY_NAME)

conanprofile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[settings]
2+
arch=x86
3+
build_type=Release
4+
compiler=msvc
5+
compiler.cppstd=20
6+
compiler.runtime=dynamic
7+
compiler.version=194
8+
os=Windows

0 commit comments

Comments
 (0)