Skip to content

Commit

Permalink
initial ci
Browse files Browse the repository at this point in the history
  • Loading branch information
localcc committed Apr 16, 2023
1 parent e31772f commit 0d29802
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 5 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

permissions:
contents: write

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

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.create-gh-release.outputs.computed-prefix }}${{ steps.create-gh-release.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: create-gh-release
uses: taiki-e/create-gh-release-action@v1
with:
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
upload-artifacts:
needs: create-release
strategy:
matrix:
config: [debug, release]
gui: [gui, nogui]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest

- uses: ilammy/msvc-dev-cmd@v1

- name: Build artifacts
uses: lukka/run-cmake@v10
with:
configurePreset: windows-${{ matrix.config }}-${{ matrix.gui }}
buildPreset: windows-${{ matrix.config }}-${{ matrix.gui }}

- name: Upload dlls
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/build/windows-${{ matrix.config }}-${{ matrix.gui }}/UnrealCppLoader/UnrealCppLoader.dll
asset_name: UnrealCppLoader-${{ matrix.gui }}-${{ matrix.config }}.dll
tag: ${{ needs.create-release.outputs.tag }}

- name: Upload pdbs
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/build/windows-${{ matrix.config }}-${{ matrix.gui }}/UnrealCppLoader/UnrealCppLoader.pdb
asset_name: UnrealCppLoader-${{ matrix.gui }}-${{ matrix.config }}.pdb
tag: ${{ needs.create-release.outputs.tag }}

- name: Upload xinput1_3
if: matrix.config == 'release' && matrix.gui == 'nogui'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/build/windows-${{ matrix.config }}-${{ matrix.gui }}/xinput1_3/xinput1_3.dll
asset_name: xinput1_3.dll
tag: ${{ needs.create-release.outputs.tag }}

publish-release:
needs: [create-release, upload-artifacts]
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: mark release as non-draft
run: |
gh release edit ${{ needs.create-release.outputs.tag }} --draft=false
96 changes: 96 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"version": 4,
"configurePresets": [
{
"name": "windows-base",
"description": "Target Windows with the Visual Studio development environment.",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Target Windows (64-bit) (Debug)",
"hidden": true,
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Target Windows (64-bit) (RelWithDebInfo)",
"hidden": true,
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},

{
"name": "windows-debug-nogui",
"displayName": "Windows x64 Debug Nogui",
"inherits": "x64-debug",
"cacheVariables": {
"ENABLE_GUI": "OFF"
}
},
{
"name": "windows-debug-gui",
"displayName": "Windows x64 Debug Gui",
"inherits": "x64-debug",
"cacheVariables": {
"ENABLE_GUI": "ON"
}
},
{
"name": "windows-release-nogui",
"displayName": "Windows x64 Release Nogui",
"inherits": "x64-release",
"cacheVariables": {
"ENABLE_GUI": "OFF"
}
},
{
"name": "windows-release-gui",
"displayName": "Windows x64 Release Gui",
"inherits": "x64-release",
"cacheVariables": {
"ENABLE_GUI": "ON"
}
}
],
"buildPresets": [
{
"name": "windows-debug-nogui",
"displayName": "Windows x64 Debug Nogui",
"configurePreset": "windows-debug-nogui"
},
{
"name": "windows-debug-gui",
"displayName": "Windows x64 Debug Gui",
"configurePreset": "windows-debug-gui"
},
{
"name": "windows-release-nogui",
"displayName": "Windows x64 Release Nogui",
"configurePreset": "windows-release-nogui"
},
{
"name": "windows-release-gui",
"displayName": "Windows x64 Release Gui",
"configurePreset": "windows-release-gui"
}
]
}
10 changes: 5 additions & 5 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(ENABLE_GUI)
FetchContent_Declare(
ImGui_Download

GIT_REPOSITORY "git@github.com:ocornut/imgui.git"
GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
GIT_TAG "2efebe331547a31b34ebf4049545df241cd04e50"
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
Expand Down Expand Up @@ -46,7 +46,7 @@ endif()
FetchContent_Declare(
MinHook

GIT_REPOSITORY "git@github.com:TsudaKageyu/minhook.git"
GIT_REPOSITORY "https://github.com/TsudaKageyu/minhook.git"
GIT_TAG "49d03ad118cf7f6768c79a8f187e14b8f2a07f94"
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
Expand All @@ -59,7 +59,7 @@ FetchContent_MakeAvailable(MinHook)
FetchContent_Declare(
fmt

GIT_REPOSITORY "git@github.com:fmtlib/fmt.git"
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
GIT_TAG "8.0.0"
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
Expand All @@ -71,7 +71,7 @@ FetchContent_MakeAvailable(fmt)
FetchContent_Declare(
spdlog

GIT_REPOSITORY "git@github.com:gabime/spdlog.git"
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG "927cc29444a294d76e83dfb898e797dc431ce094"
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
Expand All @@ -84,7 +84,7 @@ FetchContent_MakeAvailable(spdlog)
FetchContent_Declare(
nlohmann_json

GIT_REPOSITORY "git@github.com:nlohmann/json.git"
GIT_REPOSITORY "https://github.com/nlohmann/json.git"
GIT_TAG "b2306145e1789368e6f261680e8dc007e91cc986"
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
Expand Down

0 comments on commit 0d29802

Please sign in to comment.