|
1 | 1 | name: Build Plugin Dev Release |
2 | 2 |
|
3 | | -on: |
4 | | - push: |
5 | | - branches: |
6 | | - - "develop" |
| 3 | +on: push |
7 | 4 |
|
8 | 5 | env: |
9 | 6 | DLL_NAME: vACDM.dll |
10 | 7 | BUILD_CONFIGURATION: Release |
11 | 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
12 | 9 | VERSION: "0" |
13 | 10 | DEV_RELEASE: "-1" |
| 11 | + WORKSPACE: ${{ github.workspace }} |
| 12 | + WORKSPACE_BUILD: ${{ github.workspace }}/build |
14 | 13 |
|
15 | 14 | jobs: |
16 | 15 | formatting-check: |
17 | 16 | uses: ./.github/workflows/clang-format.yml |
18 | 17 |
|
19 | | - build: |
| 18 | + get-latest-version: |
20 | 19 | needs: formatting-check |
| 20 | + uses: ./.github/workflows/get-latest-version.yml |
| 21 | + |
| 22 | + build: |
| 23 | + needs: get-latest-version |
21 | 24 | runs-on: windows-latest |
22 | 25 | name: "Build plugin" |
23 | 26 |
|
24 | 27 | 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 |
31 | 30 |
|
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" |
36 | 33 |
|
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" |
43 | 39 |
|
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 |
49 | 43 |
|
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- |
52 | 52 |
|
53 | | - - name: Set up MSVC environment |
54 | | - shell: pwsh |
| 53 | + - name: Install Conan packages |
55 | 54 | 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 |
58 | 57 |
|
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 |
61 | 60 |
|
62 | 61 | - name: Build DLL |
63 | | - run: cmake --build build --config ${{env.BUILD_CONFIGURATION}} |
| 62 | + run: cmake --build ${{env.WORKSPACE_BUILD}} --config ${{env.BUILD_CONFIGURATION}} |
64 | 63 |
|
65 | 64 | - name: Create GitHub Release |
66 | 65 | id: create_release |
|
78 | 77 | uses: actions/upload-release-asset@v1 |
79 | 78 | with: |
80 | 79 | 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}} |
82 | 81 | asset_name: ${{env.DLL_NAME}} |
83 | 82 | asset_content_type: application/octet-stream |
84 | 83 | env: |
|
0 commit comments