Skip to content

Commit ef1277f

Browse files
committed
updatessss
1 parent 35fcfc0 commit ef1277f

7 files changed

Lines changed: 108 additions & 109 deletions

File tree

.github/workflows/ci.yml

Lines changed: 74 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,153 +2,158 @@ name: Build
22

33
on:
44
pull_request:
5-
branches: [main, master]
5+
branches:
6+
- main
7+
- master
8+
69
workflow_dispatch:
710
inputs:
8-
skip_windows:
9-
description: 'Skip building Windows binary'
10-
required: false
11-
default: false
11+
build_linux:
12+
description: Build Linux
13+
type: boolean
14+
default: true
15+
16+
build_windows:
17+
description: Build Windows
1218
type: boolean
19+
default: true
20+
21+
concurrency:
22+
group: build-${{ github.ref }}
23+
cancel-in-progress: true
1324

1425
jobs:
26+
1527
build-linux:
28+
if: github.event_name != 'workflow_dispatch' || inputs.build_linux
29+
1630
runs-on: ubuntu-22.04
31+
1732
permissions:
1833
contents: write
1934

2035
steps:
21-
- uses: actions/checkout@v6.0.3
36+
- uses: actions/checkout@v6
37+
38+
- name: Cache AppImage builder
39+
uses: actions/cache@v5
40+
with:
41+
path: ~/.cache/appimage-builder
42+
key: appimage-${{ hashFiles('AppImageBuilder.yml') }}
2243

2344
- name: Install dependencies
2445
run: |
25-
sudo apt-get update -y
46+
sudo apt-get update
47+
2648
sudo apt-get install -y \
27-
cmake ninja-build \
49+
ninja-build \
50+
cmake \
2851
libopencv-dev \
29-
libx11-dev libxext-dev
52+
libx11-dev \
53+
libxext-dev
3054
31-
- name: Make glue.sh executable
55+
- name: Make glue executable
3256
run: chmod +x glue.sh
3357

34-
- name: Configure and build using glue.sh
58+
- name: Build
3559
run: |
3660
./glue.sh build \
3761
-t Release \
3862
-j $(nproc) \
39-
-D CMAKE_GENERATOR=Ninja \
40-
-D CMAKE_CXX_FLAGS="-O2 -pipe -fstack-protector-strong" \
41-
-D CMAKE_EXE_LINKER_FLAGS="-Wl,-z,relro,-z,now"
63+
-D CMAKE_GENERATOR=Ninja
4264
4365
- name: Build AppImage
66+
if: github.event_name != 'pull_request'
4467
uses: AppImageCrafters/build-appimage-action@master
4568
with:
4669
recipe: AppImageBuilder.yml
4770
env:
4871
UPDATE_INFO: gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*x86_64.AppImage.zsync
4972

50-
- name: Upload build artifact
51-
uses: actions/upload-artifact@v7.0.1
73+
- name: Upload artifact
74+
uses: actions/upload-artifact@v4
5275
with:
5376
name: aimbot-linux-x86_64
54-
path: aimbot-*.AppImage
77+
path: |
78+
aimbot-*.AppImage
79+
build/aimbot
5580
56-
- name: Attach to release
81+
- name: Attach release
5782
if: startsWith(github.ref, 'refs/tags/')
58-
uses: softprops/action-gh-release@v3.0.0
83+
uses: softprops/action-gh-release@v3
5984
with:
6085
files: aimbot-*.AppImage
6186

62-
- name: Trigger CoreOS-repo package build
87+
- name: Trigger CoreOS package build
6388
if: startsWith(github.ref, 'refs/tags/')
6489
env:
6590
TAG: ${{ github.ref_name }}
6691
run: |
6792
VERSION="${TAG#v}"
93+
6894
curl -s -X POST \
6995
-H "Accept: application/vnd.github.v3+json" \
7096
-H "Authorization: Bearer ${{ secrets.COREOS_REPO_TOKEN }}" \
7197
https://api.github.com/repos/Frank1o3/CoreOS-repo/dispatches \
7298
-d "{\"event_type\":\"aimbot-release\",\"client_payload\":{\"package\":\"aimbot\",\"version\":\"${VERSION}\"}}"
7399
74100
build-windows:
75-
# Run only if:
76-
# - It's a pull_request (always), OR
77-
# - It's a workflow_dispatch and the skip_windows checkbox is NOT checked
78-
if: github.event_name != 'workflow_dispatch' || !github.event.inputs.skip_windows
101+
if: github.event_name != 'workflow_dispatch' || inputs.build_windows
102+
79103
runs-on: windows-latest
104+
80105
permissions:
81106
contents: write
82107

83108
env:
84109
VCPKG_DEFAULT_TRIPLET: x64-windows-static
85-
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\.vcpkg-cache
86-
FETCHCONTENT_BASE_DIR: ${{ github.workspace }}\.fetchcontent-cache
87110

88111
steps:
89-
- uses: actions/checkout@v6.0.3
112+
- uses: actions/checkout@v6
90113

91-
- name: Create cache dirs
92-
run: |
93-
New-Item -ItemType Directory -Force -Path "$env:VCPKG_DEFAULT_BINARY_CACHE"
94-
New-Item -ItemType Directory -Force -Path "$env:FETCHCONTENT_BASE_DIR"
95-
96-
- name: Cache vcpkg binaries
97-
uses: actions/cache@v5.0.5
98-
with:
99-
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
100-
key: vcpkg-opencv-core-imgproc-highgui-x64-static-v1
101-
restore-keys: vcpkg-opencv-core-imgproc-highgui-x64-static-
114+
- name: Setup Ninja
115+
uses: seanmiddleditch/gha-setup-ninja@v6
102116

103-
- name: Cache vcpkg installed
104-
id: vcpkg-installed
105-
uses: actions/cache@v5.0.5
117+
- name: Cache vcpkg
118+
uses: actions/cache@v5
106119
with:
107-
path: ${{ env.VCPKG_INSTALLATION_ROOT }}\installed
108-
key: vcpkg-installed-opencv-core-imgproc-highgui-x64-static-v1
109-
restore-keys: vcpkg-installed-opencv-core-imgproc-highgui-x64-static-
110-
111-
- name: Install OpenCV via vcpkg
112-
if: steps.vcpkg-installed.outputs.cache-hit != 'true'
113-
run: vcpkg install "opencv:x64-windows-static"
120+
path: |
121+
${{ env.VCPKG_INSTALLATION_ROOT }}\downloads
122+
${{ env.VCPKG_INSTALLATION_ROOT }}\installed
123+
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
114124

115125
- name: Cache FetchContent
116-
uses: actions/cache@v5.0.5
117-
with:
118-
path: ${{ env.FETCHCONTENT_BASE_DIR }}
119-
key: fetchcontent-${{ hashFiles('**/CMakeLists.txt') }}
120-
restore-keys: fetchcontent-
121-
122-
- name: Cache build directory
123-
uses: actions/cache@v5.0.5
126+
uses: actions/cache@v5
124127
with:
125-
path: build/windows
126-
key: build-windows-${{ hashFiles('src/**', 'includes/**', 'CMakeLists.txt') }}
127-
restore-keys: build-windows-
128+
path: |
129+
build/_deps
130+
key: fetchcontent-${{ hashFiles('CMakeLists.txt') }}
128131

129132
- name: Configure
130133
run: |
131-
cmake -S . -B build/windows `
134+
cmake -S . -B build `
135+
-G Ninja `
132136
-DCMAKE_BUILD_TYPE=Release `
133137
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
134138
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
135-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
136-
-DFETCHCONTENT_BASE_DIR="${{ env.FETCHCONTENT_BASE_DIR }}"
139+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
137140
138141
- name: Build
139-
run: cmake --build build/windows --config Release --parallel
142+
run: |
143+
cmake --build build --parallel
140144
141-
- name: Rename artifact
142-
run: Copy-Item build/windows/Release/aimbot.exe aimbot-windows-x86_64.exe
145+
- name: Rename executable
146+
run: |
147+
Copy-Item build/aimbot.exe aimbot-windows-x86_64.exe
143148
144-
- name: Upload build artifact
145-
uses: actions/upload-artifact@v7.0.1
149+
- name: Upload artifact
150+
uses: actions/upload-artifact@v4
146151
with:
147152
name: aimbot-windows-x86_64
148153
path: aimbot-windows-x86_64.exe
149154

150-
- name: Attach to release
155+
- name: Attach release
151156
if: startsWith(github.ref, 'refs/tags/')
152-
uses: softprops/action-gh-release@v3.0.0
157+
uses: softprops/action-gh-release@v3
153158
with:
154159
files: aimbot-windows-x86_64.exe

AppImageBuilder.yml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
11
version: 1
22

3-
script:
4-
- rm -rf AppDir | true
5-
- mkdir -p AppDir/usr/bin
6-
- cp build/aimbot AppDir/usr/bin/
7-
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
8-
- cp aimbot.png AppDir/usr/share/icons/hicolor/256x256/apps/aimbot.png
9-
- mkdir -p AppDir/usr/share/pixmaps
10-
- cp aimbot.png AppDir/usr/share/pixmaps/aimbot.png
11-
- mkdir -p AppDir/usr/share/icons
12-
- cp aimbot.png AppDir/usr/share/icons/aimbot.png
13-
- mkdir -p AppDir/usr/share/applications
14-
- cp aimbot.desktop AppDir/usr/share/applications/
15-
163
AppDir:
17-
path: ./AppDir
4+
path: AppDir
5+
186
app_info:
19-
id: aimbot
7+
id: com.frank1o3.aimbot
208
name: aimbot
219
icon: aimbot
2210
version: latest
2311
exec: usr/bin/aimbot
24-
exec_args: "$@"
12+
13+
files:
14+
include:
15+
- build/aimbot
16+
- assets/aimbot.desktop
17+
- assets/aimbot.png
2518

2619
apt:
27-
arch:
28-
- amd64
20+
arch: amd64
21+
2922
sources:
30-
- sourceline: 'deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse'
31-
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
23+
- sourceline: "deb http://archive.ubuntu.com/ubuntu jammy main universe"
24+
3225
include:
3326
- libopencv-core4.5d
3427
- libopencv-imgproc4.5d
35-
- libopencv-imgcodecs4.5d
3628
- libopencv-highgui4.5d
3729
- libx11-6
3830
- libxext6
39-
- libstdc++6
40-
- libgcc-s1
41-
- libc6
4231

43-
files:
44-
include:
45-
- /usr/lib/x86_64-linux-gnu/libopencv_core.so.4.5.4
46-
- /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.4.5.4
47-
- /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.5.4
48-
- /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.4.5.4
49-
- /usr/lib/x86_64-linux-gnu/libxcb.so.1
50-
- /usr/lib/x86_64-linux-gnu/libX11.so.6
51-
- /usr/lib/x86_64-linux-gnu/libXext.so.6
52-
exclude:
53-
- usr/share
54-
- usr/lib/debug
32+
AppImage:
33+
arch: x86_64

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(MSVC)
1515
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
1616
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
1717
else()
18-
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
18+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
1919
endif()
2020

2121
# ── Dependencies ──────────────────────────────────────────────────────────────
@@ -48,14 +48,14 @@ else()
4848
if(PYTHON_CV2_RESULT EQUAL 0 AND EXISTS "${PYTHON_CV2_PATH}")
4949
message(STATUS "Using OpenCV from Python installation: ${PYTHON_CV2_PATH}")
5050
set(OpenCV_INCLUDE_DIRS "${PYTHON_CV2_PATH}/include")
51-
find_library(OpenCV_LIB_PYTHON cv2.abi3
52-
PATHS "${PYTHON_CV2_PATH}"
51+
find_library(OpenCV_LIB_PYTHON cv2.abi3
52+
PATHS "${PYTHON_CV2_PATH}"
5353
NO_DEFAULT_PATH)
5454
if(OpenCV_LIB_PYTHON)
5555
set(OpenCV_LIBRARIES ${OpenCV_LIB_PYTHON})
5656
endif()
5757
endif()
58-
58+
5959
if(NOT OpenCV_FOUND AND NOT OpenCV_LIBRARIES)
6060
message(STATUS "OpenCV not found, will attempt to link dynamically...")
6161
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.

vcpkg.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "aimbot",
3+
"version-string": "1.0.0",
4+
"dependencies": [
5+
{
6+
"name": "opencv",
7+
"default-features": false,
8+
"features": [
9+
"core",
10+
"imgproc",
11+
"highgui"
12+
]
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)