Files
xmrig/.gitea/workflows/build.yml
T
Codex Bot fcf562ce15
build / Build Linux CPU (push) Failing after 1m31s
build / Build Windows CPU (push) Failing after 3m40s
Add xmrig CPU build and release workflows
2026-04-18 20:08:54 +02:00

126 lines
3.4 KiB
YAML

name: build
on:
push:
branches:
- master
paths:
- ".gitea/workflows/build.yml"
- "CMakeLists.txt"
- "cmake/**"
- "scripts/**"
- "src/**"
- "res/**"
workflow_dispatch:
inputs:
target_ref:
description: "Git ref to build"
required: false
default: "master"
jobs:
build-linux:
name: Build Linux CPU
runs-on: ubuntu-latest
steps:
- name: Checkout push ref
uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}
- name: Checkout requested ref
uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ inputs.target_ref }}
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libuv1-dev
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_TLS=OFF \
-DWITH_HWLOC=OFF \
-DWITH_OPENCL=OFF \
-DWITH_CUDA=OFF \
-DWITH_NVML=OFF \
-DWITH_ADL=OFF
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Package
run: |
mkdir -p dist/linux
cp build/xmrig dist/linux/
cp config.json README.md LICENSE dist/linux/
tar -C dist/linux -czf xmrig-peya-linux-x86_64.tar.gz .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xmrig-peya-linux-x86_64
path: xmrig-peya-linux-x86_64.tar.gz
build-windows:
name: Build Windows CPU
runs-on: windows-latest
steps:
- name: Checkout push ref
uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}
- name: Checkout requested ref
uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ inputs.target_ref }}
- name: Ensure vcpkg
shell: cmd
run: |
if exist C:\vcpkg (
echo Using existing vcpkg at C:\vcpkg
) else (
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
call C:\vcpkg\bootstrap-vcpkg.bat
)
C:\vcpkg\vcpkg.exe install libuv:x64-windows-static
- name: Configure
shell: cmd
run: |
cmake -S . -B build -A x64 ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows-static ^
-DWITH_TLS=OFF ^
-DWITH_HWLOC=OFF ^
-DWITH_OPENCL=OFF ^
-DWITH_CUDA=OFF ^
-DWITH_NVML=OFF ^
-DWITH_ADL=OFF
- name: Build
shell: cmd
run: cmake --build build --config Release
- name: Package
shell: cmd
run: |
if not exist dist\windows mkdir dist\windows
copy build\Release\xmrig.exe dist\windows\
copy config.json dist\windows\
copy README.md dist\windows\
copy LICENSE dist\windows\
powershell -NoProfile -Command "Compress-Archive -Path dist\\windows\\* -DestinationPath xmrig-peya-windows-x86_64.zip -Force"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xmrig-peya-windows-x86_64
path: xmrig-peya-windows-x86_64.zip