-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (123 loc) · 4.97 KB
/
Copy pathci.yml
File metadata and controls
147 lines (123 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build
on:
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6.0.2
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y \
cmake ninja-build \
libopencv-dev \
libx11-dev libxext-dev
- name: Configure (portable build)
run: |
cmake -S . -B build/linux \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS="-O2 -pipe -fstack-protector-strong" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,relro,-z,now"
- name: Build
run: cmake --build build/linux --parallel
- name: Rename artifact
run: cp build/linux/aimbot aimbot-linux-x86_64
- name: Upload build artifact
uses: actions/upload-artifact@v7.0.1
with:
name: aimbot-linux-x86_64
path: aimbot-linux-x86_64
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3.0.0
with:
files: aimbot-linux-x86_64
- name: Trigger CoreOS-repo package build
if: startsWith(github.ref, 'refs/tags/')
env:
TAG: ${{ github.ref_name }}
run: |
VERSION="${TAG#v}"
curl -s -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.COREOS_REPO_TOKEN }}" \
https://api.github.com/repos/Frank1o3/CoreOS-repo/dispatches \
-d "{\"event_type\":\"aimbot-release\",\"client_payload\":{\"package\":\"aimbot\",\"version\":\"${VERSION}\"}}"
build-windows:
runs-on: windows-latest
permissions:
contents: write
env:
VCPKG_DEFAULT_TRIPLET: x64-windows-static
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\.vcpkg-cache
# Points FetchContent cache to a stable location we can also cache
FETCHCONTENT_BASE_DIR: ${{ github.workspace }}\.fetchcontent-cache
steps:
- uses: actions/checkout@v6.0.2
- name: Create cache dirs
run: |
New-Item -ItemType Directory -Force -Path "$env:VCPKG_DEFAULT_BINARY_CACHE"
New-Item -ItemType Directory -Force -Path "$env:FETCHCONTENT_BASE_DIR"
# Cache the vcpkg binary cache (compiled .zip archives)
- name: Cache vcpkg binaries
uses: actions/cache@v5.0.5
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: vcpkg-opencv-core-imgproc-highgui-x64-static-v1
restore-keys: vcpkg-opencv-core-imgproc-highgui-x64-static-
# Cache the vcpkg installed tree — skip the install step entirely on hit
- name: Cache vcpkg installed
id: vcpkg-installed
uses: actions/cache@v5.0.5
with:
path: ${{ env.VCPKG_INSTALLATION_ROOT }}\installed
key: vcpkg-installed-opencv-core-imgproc-highgui-x64-static-v1
restore-keys: vcpkg-installed-opencv-core-imgproc-highgui-x64-static-
# Only build the 3 modules actually used — skips calib3d, dnn, features2d,
# flann, ml, objdetect, photo, stitching, video, videoio, etc.
- name: Install OpenCV via vcpkg
if: steps.vcpkg-installed.outputs.cache-hit != 'true'
run: vcpkg install "opencv:x64-windows-static"
# Cache FetchContent downloads (nlohmann_json tarball)
- name: Cache FetchContent
uses: actions/cache@v5.0.5
with:
path: ${{ env.FETCHCONTENT_BASE_DIR }}
key: fetchcontent-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: fetchcontent-
# Cache the build dir for incremental recompilation on code-only changes
- name: Cache build directory
uses: actions/cache@v5.0.5
with:
path: build/windows
key: build-windows-${{ hashFiles('src/**', 'includes/**', 'CMakeLists.txt') }}
restore-keys: build-windows-
- name: Configure
run: |
cmake -S . -B build/windows `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DFETCHCONTENT_BASE_DIR="${{ env.FETCHCONTENT_BASE_DIR }}"
- name: Build
run: cmake --build build/windows --config Release --parallel
- name: Rename artifact
run: Copy-Item build/windows/Release/aimbot.exe aimbot-windows-x86_64.exe
- name: Upload build artifact
uses: actions/upload-artifact@v7.0.1
with:
name: aimbot-windows-x86_64
path: aimbot-windows-x86_64.exe
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3.0.0
with:
files: aimbot-windows-x86_64.exe