Skip to content

Commit ef1c878

Browse files
committed
chore: linux build makefile and github workflow
1 parent f39a0b1 commit ef1c878

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build CS2RemoteConsole-server (Linux)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- 'CS2RemoteConsole-server/**'
8+
pull_request:
9+
branches: [ master ]
10+
paths:
11+
- 'CS2RemoteConsole-server/**'
12+
workflow_dispatch:
13+
14+
jobs:
15+
build-cs2remoteconsole-server-linux:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Set up GCC
23+
uses: egor-tensin/setup-gcc@v1
24+
with:
25+
version: latest
26+
platform: x64
27+
28+
- name: Build CS2RemoteConsole-server
29+
run: |
30+
cd CS2RemoteConsole-server
31+
make
32+
33+
- name: Prepare artifact directory
34+
run: |
35+
mkdir -p artifact
36+
cp CS2RemoteConsole-server/CS2RemoteConsole-server artifact/
37+
38+
- name: Verify artifact contents
39+
run: |
40+
echo "Verifying artifact contents:"
41+
ls -l artifact
42+
43+
- name: Upload CS2RemoteConsole-server artifact
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: CS2RemoteConsole-server-linux-build
47+
path: artifact

CS2RemoteConsole-server/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CXX = g++
2+
CXXFLAGS = -std=c++17 -Wall -Wextra -pedantic
3+
LDFLAGS = -pthread
4+
5+
SRC_DIR = src
6+
OBJ_DIR = obj
7+
8+
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
9+
OBJECTS = $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
10+
11+
TARGET = CS2RemoteConsole-server
12+
13+
.PHONY: all clean
14+
15+
all: $(TARGET)
16+
17+
$(TARGET): $(OBJECTS)
18+
$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
19+
20+
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
21+
$(CXX) $(CXXFLAGS) -c $< -o $@
22+
23+
$(OBJ_DIR):
24+
mkdir -p $@
25+
26+
clean:
27+
rm -rf $(OBJ_DIR) $(TARGET)

0 commit comments

Comments
 (0)