Skip to content

Commit da8dbb4

Browse files
authored
Merge pull request #5 from Hagb/workflow
Add a GitHub workflow to build
2 parents fc0657d + 635370b commit da8dbb4

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
on:
3+
workflow_dispatch:
4+
push:
5+
pull_request:
6+
types: [opened]
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
config: ["Release", "Debug"]
13+
runs-on: windows-2022
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
19+
with:
20+
arch: amd64_x86
21+
- name: build
22+
shell: bash
23+
run: |
24+
mkdir build upload
25+
touch upload/.a-workaround-to-avoid-being-flattened
26+
cd build
27+
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.config }}
28+
project_name=$(grep '^CMAKE_PROJECT_NAME:STATIC=' CMakeCache.txt | cut -d = -f 2-)
29+
config=${{ matrix.config }}
30+
echo "ARTIFACT_NAME=${project_name}_${config,,}" >> ${GITHUB_ENV}
31+
echo "PROJECT_NAME=${project_name}" >> ${GITHUB_ENV}
32+
cmake --build .
33+
cmake --install . --prefix "../artifact/${project_name}"
34+
- name: Upload the ${{ matrix.config }} binary
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: ${{ env.ARTIFACT_NAME }}
38+
path: |
39+
artifact/${{ env.PROJECT_NAME }}
40+
artifact/.a-workaround-to-avoid-being-flattened
41+
!artifact/.a-workaround-to-avoid-being-flattened

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@ target_link_libraries(
4848
d3d9
4949
d3dx9
5050
)
51+
52+
# binary
53+
install(TARGETS "${PROJECT_NAME}" DESTINATION .)
54+
# PDB file
55+
install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> DESTINATION . OPTIONAL)
56+
# license and other common files
57+
install(FILES LICENSE DESTINATION .)

0 commit comments

Comments
 (0)