Skip to content

Commit

Permalink
Merge pull request #24 from Devaniti/patch-3
Browse files Browse the repository at this point in the history
Implemented GitHub Actions
  • Loading branch information
sawickiap authored Nov 27, 2024
2 parents 91a7cf2 + 403429a commit faadf58
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 13 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on: [push]

jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Sync
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Configure
shell: pwsh
run: cmake -S . -B build

- name: Build Debug
shell: pwsh
run: cmake --build build --config Debug

- name: Upload Debug artifacts
uses: actions/upload-artifact@v4
with:
name: D3d12info - Debug
path: ./build/Debug/

- name: Build Release
shell: pwsh
run: cmake --build build --config Release

- name: Upload Release artifacts
uses: actions/upload-artifact@v4
with:
name: D3d12info - Release
path: |
./build/Release/
! ./build/Release/*.lib
! ./build/Release/*.exp
76 changes: 76 additions & 0 deletions .github/workflows/Package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Package

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
id-token: write
contents: read

jobs:
package:
name: Package
runs-on: windows-2022
environment: production
steps:
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Sync
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Configure
shell: pwsh
run: cmake -S . -B build

- name: Build Release
shell: pwsh
run: cmake --build build --config Release

- name: Sign with Trusted Signing
uses: azure/[email protected]
with:
endpoint: https://eus.codesigning.azure.net/
trusted-signing-account-name: dmytro-bulatov-sign
certificate-profile-name: dmytro-bulatov
files: |
${{ github.workspace }}/build/Release/D3d12info.exe
${{ github.workspace }}/build/Release/D3d12info_preview.exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
exclude-environment-credential: true
exclude-workload-identity-credential: true
exclude-managed-identity-credential: true
exclude-shared-token-cache-credential: true
exclude-visual-studio-credential: true
exclude-visual-studio-code-credential: true
exclude-azure-cli-credential: false
exclude-azure-powershell-credential: true
exclude-azure-developer-cli-credential: true
exclude-interactive-browser-credential: true

- name: Prepare Package
shell: pwsh
run: |
$PackagePath = "./package/D3d12info"
New-Item -ItemType Directory -Path $PackagePath
Copy-Item -Path "./build/Release/*" -Destination $PackagePath -Recurse -Exclude *.lib, *.exp
Copy-Item -Path "./LICENSE.txt" -Destination $PackagePath
Copy-Item -Path "./CHANGELOG.md" -Destination $PackagePath
Copy-Item -Path "./D3d12info on GitHub.url" -Destination $PackagePath
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: D3d12info
path: ./package/
compression-level: 9
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build/
/package/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "Src/ThirdParty/AGS_SDK"]
path = Src/ThirdParty/AGS_SDK
url = https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK.git
[submodule "Src/ThirdParty/Vulkan-Headers"]
path = Src/ThirdParty/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
20 changes: 9 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ else()
message(STATUS "NVAPI library not used.")
endif()

option(ENABLE_VULKAN "Enables usage of Vulkan SDK." ON)
option(ENABLE_VULKAN "Enables usage of Vulkan." ON)
if(ENABLE_VULKAN)
# 1.3.231 is oldest tested Vulkan SDK version
# if Cmake finds older version, it will print warning and set Vulkan_FOUND to false
find_package(Vulkan 1.3.231)
if (Vulkan_FOUND)
message(STATUS "Vulkan SDK found. Include directory is \"${Vulkan_INCLUDE_DIRS}\".")
if(EXISTS "${PROJECT_SOURCE_DIR}/Src/ThirdParty/Vulkan-Headers/CMakeLists.txt")
message(STATUS "Vulkan library used.")
add_subdirectory("${PROJECT_SOURCE_DIR}/Src/ThirdParty/Vulkan-Headers" Vulkan-Headers)
else()
message(STATUS "Vulkan SDK not found. Please install Vulkan SDK or set ENABLE_VULKAN to OFF.")
message(STATUS "Vulkan library not found. This is likely due to missing submodule. Please initialize submodules or set ENABLE_VULKAN to OFF.")
set(ENABLE_VULKAN OFF)
endif()
else()
message(STATUS "Vulkan SDK not used.")
message(STATUS "Vulkan library not used.")
endif()

option(ENABLE_INTEL_GPUDETECT "Enable usage of Intel GPU Detect library." ON)
Expand Down Expand Up @@ -119,10 +118,9 @@ function(add_my_executable USE_PREVIEW_AGILITY_SDK)
target_link_libraries(${EXE_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/Src/ThirdParty/nvapi/amd64/nvapi64.lib")
endif()

if (Vulkan_FOUND)
if (ENABLE_VULKAN)
target_compile_definitions(${EXE_NAME} PRIVATE USE_VULKAN=1)
target_include_directories(${EXE_NAME} PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(${EXE_NAME} PRIVATE ${Vulkan_LIBRARIES})
target_link_libraries(${EXE_NAME} PRIVATE Vulkan::Headers)
endif()

if(ENABLE_INTEL_GPUDETECT)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ It uses following thirt-party libraries:
- **[Intel GPU Detect](https://github.com/GameTechDev/gpudetect)** - custom vendor extensions to graphics APIs by Intel. License: Apache 2.0.
- Linked via submodule.
- Optional, controlled by Cmake variable `ENABLE_INTEL_GPUDETECT` - on by default.
- **[Vulkan SDK](https://www.lunarg.com/vulkan-sdk/)**
- Linked externally. Cmake automatically detects Vulkan SDK path.
- **[Vulkan Headers](https://github.com/KhronosGroup/Vulkan-Headers)**
- Linked via submodule.
- Optional, controlled by Cmake variable `ENABLE_VULKAN` - on by default.
1 change: 1 addition & 0 deletions Src/ThirdParty/Vulkan-Headers
Submodule Vulkan-Headers added at 98f440

0 comments on commit faadf58

Please sign in to comment.