From 5ea903da3ec9b2b81491acbbf1a4820641012e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Wed, 17 Jul 2024 13:13:01 +0200 Subject: [PATCH 1/7] Create cmake-single-platform.yml --- .github/workflows/cmake-single-platform.yml | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/cmake-single-platform.yml diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml new file mode 100644 index 0000000..4f929d9 --- /dev/null +++ b/.github/workflows/cmake-single-platform.yml @@ -0,0 +1,39 @@ +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml +name: CMake on a single platform + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + From 9c42f8347b50168264a015370b74efd673821840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Thu, 18 Jul 2024 23:41:45 +0200 Subject: [PATCH 2/7] Update cmake-single-platform.yml Add archiving step. --- .github/workflows/cmake-single-platform.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 4f929d9..e6795ec 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -4,9 +4,8 @@ name: CMake on a single platform on: push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + tags: + - v* env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -37,3 +36,10 @@ jobs: # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} + - name: Archive built package + uses: actions/upload-artifact@v4 + with: + name: hotkey-detective-${{startsWith(github.ref_name, "v") && gitub.ref_name || "v0.0.0"}} + path: | + build/HotkeyDetective.exe + build/dll/hotkey_hook.dll From 33e30ff3baaea721a8316bda2d87966b5d615822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Thu, 18 Jul 2024 23:49:41 +0200 Subject: [PATCH 3/7] Update cmake-single-platform.yml Bring back building on pull request. --- .github/workflows/cmake-single-platform.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index e6795ec..7ab234b 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -6,6 +6,8 @@ on: push: tags: - v* + pull_request: + branches: [ "master" ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -39,7 +41,7 @@ jobs: - name: Archive built package uses: actions/upload-artifact@v4 with: - name: hotkey-detective-${{startsWith(github.ref_name, "v") && gitub.ref_name || "v0.0.0"}} + name: hotkey-detective-${{startsWith(github.ref_name, "v") && gitub.ref_name || "SNAPSHOT"}} path: | build/HotkeyDetective.exe build/dll/hotkey_hook.dll From da3425a49bc75e6941409a810886b99c589306dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Thu, 18 Jul 2024 23:52:06 +0200 Subject: [PATCH 4/7] Update cmake-single-platform.yml Replace double quotes with single quotes. --- .github/workflows/cmake-single-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 7ab234b..5262c2f 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -41,7 +41,7 @@ jobs: - name: Archive built package uses: actions/upload-artifact@v4 with: - name: hotkey-detective-${{startsWith(github.ref_name, "v") && gitub.ref_name || "SNAPSHOT"}} + name: hotkey-detective-${{startsWith(github.ref_name, 'v') && gitub.ref_name || 'SNAPSHOT'}} path: | build/HotkeyDetective.exe build/dll/hotkey_hook.dll From d1952bacf0aa8723294b946f8239490f7962f356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Thu, 18 Jul 2024 23:52:40 +0200 Subject: [PATCH 5/7] Update cmake-single-platform.yml Fix stupid typo. --- .github/workflows/cmake-single-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 5262c2f..7a0460a 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -41,7 +41,7 @@ jobs: - name: Archive built package uses: actions/upload-artifact@v4 with: - name: hotkey-detective-${{startsWith(github.ref_name, 'v') && gitub.ref_name || 'SNAPSHOT'}} + name: hotkey-detective-${{startsWith(github.ref_name, 'v') && github.ref_name || 'SNAPSHOT'}} path: | build/HotkeyDetective.exe build/dll/hotkey_hook.dll From 832e44b9ed299a60ab3fb47a63a644a2509a2161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Fri, 19 Jul 2024 00:01:13 +0200 Subject: [PATCH 6/7] Update cmake-single-platform.yml Specify precisely the path to look for files to archive. --- .github/workflows/cmake-single-platform.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 7a0460a..8bb4ea7 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -41,7 +41,7 @@ jobs: - name: Archive built package uses: actions/upload-artifact@v4 with: - name: hotkey-detective-${{startsWith(github.ref_name, 'v') && github.ref_name || 'SNAPSHOT'}} + name: hotkey-detective-${{ startsWith(github.ref_name, 'v') && github.ref_name || 'SNAPSHOT' }} path: | - build/HotkeyDetective.exe - build/dll/hotkey_hook.dll + ${{ github.workspace }}/build/HotkeyDetective.exe + ${{ github.workspace }}/build/dll/hotkey_hook.dll From b0ecb83b0d6f4d78f9a489b509aa915860502a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20B=C4=85k?= Date: Fri, 19 Jul 2024 00:03:59 +0200 Subject: [PATCH 7/7] Update cmake-single-platform.yml --- .github/workflows/cmake-single-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 8bb4ea7..80999f7 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -43,5 +43,5 @@ jobs: with: name: hotkey-detective-${{ startsWith(github.ref_name, 'v') && github.ref_name || 'SNAPSHOT' }} path: | - ${{ github.workspace }}/build/HotkeyDetective.exe - ${{ github.workspace }}/build/dll/hotkey_hook.dll + ${{ github.workspace }}/build/Release/HotkeyDetective.exe + ${{ github.workspace }}/build/dll/Release/hotkey_hook.dll