@@ -24,29 +24,18 @@ jobs:
2424 with :
2525 fetch-depth : 0
2626
27- - name : ' Setup CMake'
28- uses : jwlawson/ actions-setup-cmake@v2
27+ - name : ' Setup and configure CMake'
28+ uses : ' ./.github/ actions/setup_and_configure_cmake '
2929 with :
30- cmake-version : ' 3.31.x'
31-
32- - name : ' Configure CMake'
33- run : |
34- cmake --preset windows-vs-release
30+ preset : ' windows-vs-release'
3531
3632 - name : ' Build'
3733 id : build
38- run : |
39- cmake --build --preset windows-vs-release --config Release --target cpp_bindings_windows
40-
41- - name : ' Set PACKAGE_VERSION from env.bat'
42- id : version
43- shell : pwsh
44- run : |
45- $content = Get-Content -Raw build/env.bat
46- echo "$content"
47- $m = [regex]::Match($content, 'PACKAGE_VERSION=(.+)')
48- $v = if ($m.Success) { $m.Groups[1].Value.Trim() } else { '0.0.0' }
49- echo "PACKAGE_VERSION=$v" >> $env:GITHUB_OUTPUT
34+ uses : ' ./.github/actions/build_binary_and_export_env'
35+ with :
36+ preset : ' windows-vs-release'
37+ config : ' Release'
38+ target : ' cpp_bindings_windows'
5039
5140 - name : ' Copy DLL to stable path and upload artifact'
5241 shell : pwsh
@@ -63,31 +52,23 @@ jobs:
6352 name : cpp_bindings_windows
6453 path : build/out/cpp_bindings_windows.dll
6554
66- - name : ' Check tag'
55+ - name : ' Check valid semver tag'
6756 id : check-tag
68- shell : pwsh
69- env :
70- PACKAGE_VERSION : ${{ steps.version.outputs.PACKAGE_VERSION }}
71-
72- run : |
73- $v = $env:PACKAGE_VERSION
74- if ($v -match '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(alpha|rc|beta|experimental)\.[1-9]\d*)?$') {
75- echo "IS_VALID_PACKAGE_VERSION=true" >> $env:GITHUB_OUTPUT
76- } else {
77- echo "IS_VALID_PACKAGE_VERSION=false" >> $env:GITHUB_OUTPUT
78- }
57+ uses : ' ./.github/actions/check_valid_semver_tag'
58+ with :
59+ tag : ${{ steps.build.outputs.PACKAGE_VERSION }}
7960
8061 - name : ' Create GitHub Release'
8162 if : github.ref_type == 'tag' && steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION == 'true'
8263 uses : softprops/action-gh-release@v2
8364 with :
84- name : ' v${{ steps.version .outputs.PACKAGE_VERSION }}'
65+ name : ' v${{ steps.build .outputs.PACKAGE_VERSION }}'
8566 tag_name : ${{ github.ref_name }}
8667 generate_release_notes : true
8768 files : build/out/cpp_bindings_windows.dll
8869
8970 outputs :
90- package_version : ${{ steps.version .outputs.PACKAGE_VERSION }}
71+ package_version : ${{ steps.build .outputs.PACKAGE_VERSION }}
9172 is_valid_package_version : ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }}
9273
9374 test-unit-cpp :
0 commit comments