commit 62fe57e7f2479d5c1f19eb78f560797dc81d6fd3 Author: Liam Chan Date: Tue Dec 17 02:53:27 2024 -0500 Add .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8fdd5ac --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: Build XMRig + +on: + push: + branches: + - main + +jobs: + xmrig-linux-static-x64: + runs-on: ubuntu-latest + steps: + - name: Checkout XMRig code + uses: actions/checkout@v4 + with: + repository: xmrig/xmrig + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git build-essential cmake libuv1-dev libssl-dev libhwloc-dev upx + + - name: Disable the XMRig donate function + run: | + sed -i 's/DonateLevel\ =\ 1/DonateLevel\ =\ 0/g' src/donate.h + sed -i 's/"donate-level":\ 1/"donate-level":\ 0/g' src/core/config/Config_default.h + sed -i 's/"donate-over-proxy":\ 1/"donate-over-proxy":\ 0/g' src/core/config/Config_default.h + sed -i 's/donate.v2.xmrig.com:3333/xmr-us-west1.nanopool.org:10343/g' src/core/config/Config_default.h + sed -i 's/${{ secrets.WALLET_ADDRESS }}/xmrig/g' src/core/config/Config_default.h + sed -i 's/"nicehash":\ false/"nicehash":\ true/g' src/core/config/Config_default.h + sed -i 's/"tls":\ false/"tls":\ true/g' src/core/config/Config_default.h + + - name: Build library dependencies + run: | + cd scripts && ./build_deps.sh + + - name: Build XMRig binary + run: | + mkdir build && cd build + cmake .. -DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON -DWITH_EMBEDDED_CONFIG=ON + make -j$(nproc) + + - name: Compress executable files + run: | + cd build + strip xmrig + upx xmrig + + - name: Archive artifacts + uses: actions/upload-artifact@v3 + with: + name: xmrig-linux-static-x64 + path: build/xmrig