Skip to content

Commit c6e8b5a

Browse files
committed
Create cmake.yml
Update cmake.yml Upload a Build Artifact Create msbuild.yml Update msbuild.yml using build matrix test action-upterm debug debug debug debug debug debug debug debug debug debug debug debug Artifact test for macos-11 find /usr -name "libcrt0*" sudo find /usr -name "libcrt0*" -static -static -static
1 parent 71a5155 commit c6e8b5a

File tree

2 files changed

+67
-4
lines changed

2 files changed

+67
-4
lines changed

.github/workflows/cmake.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CMake
2+
3+
on:
4+
push:
5+
branches: [ "*" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
CMAKE_BUILD_TYPE: Release
12+
13+
jobs:
14+
build-binaries:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform: [macos-latest, ubuntu-latest, windows-latest]
19+
20+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
21+
# You can convert this to a matrix build if you need cross-platform coverage.
22+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
23+
runs-on: ${{ matrix.platform }}
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Configure CMake
29+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
30+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
31+
run: |
32+
mkdir build
33+
cd build
34+
cmake ..
35+
36+
- name: Build
37+
# Build your program with the given configuration
38+
run: |
39+
cd build
40+
cmake --build . --config ${{ env.CMAKE_BUILD_TYPE }}
41+
ls
42+
43+
- name: Upload Posix Build Artifact
44+
uses: actions/[email protected]
45+
if: runner.os != 'Windows'
46+
with:
47+
# Artifact name
48+
name: cgit_${{ runner.os }}
49+
# A file, directory or wildcard pattern that describes what to upload
50+
path: build/cgit
51+
retention-days: 15
52+
53+
- name: Upload Windows Build Artifact
54+
uses: actions/[email protected]
55+
if: runner.os == 'Windows'
56+
with:
57+
# Artifact name
58+
name: cgit_${{ runner.os }}
59+
# A file, directory or wildcard pattern that describes what to upload
60+
path: build/${{ env.CMAKE_BUILD_TYPE }}/cgit.exe
61+
retention-days: 15

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ project(cgit CXX)
33

44
set(CMAKE_CXX_STANDARD 11)
55

6-
IF (WIN32)
6+
if (WIN32)
77
set(CMAKE_CXX_FLAGS_RELEASE "/MT ${CMAKE_CXX_FLAGS}")
88
set(CMAKE_CXX_FLAGS_DEBUG "/MTd ${CMAKE_CXX_FLAGS}")
9-
ELSE ()
10-
set(CMAKE_CXX_FLAGS "-static ${CMAKE_CXX_FLAGS}")
11-
ENDIF ()
9+
elseif (APPLE)
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
11+
else ()
12+
set(CMAKE_CXX_FLAGS "-static ${CMAKE_CXX_FLAGS}")
13+
endif ()
1214
add_executable(cgit src/main.cpp src/cgit.cpp src/string.hpp src/utils.hpp src/utils.cpp)
1315

1416
message(STATUS ${CMAKE_INSTALL_BINDIR})

0 commit comments

Comments
 (0)