Build #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.3 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| cmake ninja-build \ | |
| libopencv-dev \ | |
| libx11-dev libxext-dev | |
| - name: Make glue.sh executable | |
| run: chmod +x glue.sh | |
| - name: Configure and build using glue.sh | |
| run: | | |
| ./glue.sh build \ | |
| -t Release \ | |
| -j $(nproc) \ | |
| -D CMAKE_GENERATOR=Ninja \ | |
| -D CMAKE_CXX_FLAGS="-O2 -pipe -fstack-protector-strong" \ | |
| -D CMAKE_EXE_LINKER_FLAGS="-Wl,-z,relro,-z,now" | |
| - name: Build AppImage | |
| uses: AppImageCrafters/build-appimage-action@master | |
| with: | |
| recipe: AppImageBuilder.yml | |
| env: | |
| UPDATE_INFO: gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*x86_64.AppImage.zsync | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: aimbot-linux-x86_64 | |
| path: aimbot-*.AppImage | |
| - name: Attach to release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v3.0.0 | |
| with: | |
| files: aimbot-*.AppImage | |
| - 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 |