This commit is contained in:
parent
e62fca3331
commit
802e847c6c
74
.github/workflows/build.yml
vendored
74
.github/workflows/build.yml
vendored
@ -1,63 +1,39 @@
|
|||||||
name: Build XMRig
|
name: Build XMRig
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
xmrig-linux-static-x64:
|
build-xmrig-linux-static:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: alpine:latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Patch Alpine container into actions runner environment
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: false
|
||||||
|
tags: xmrig:latest
|
||||||
|
-
|
||||||
|
name: Copy XMRig
|
||||||
run: |
|
run: |
|
||||||
apk add nodejs
|
id=$(docker create xmrig:latest)
|
||||||
shell: sh # No bash in Alpine by default
|
docker cp $id:/xmrig/build/xmrig - > build/xmrig.tar
|
||||||
|
tar -xvf build/xmrig.tar -C build && rm build/xmrig.tar
|
||||||
- name: Install dependencies
|
docker rm -v $id
|
||||||
run: |
|
-
|
||||||
apk add git make cmake libstdc++ gcc g++ automake libtool autoconf linux-headers upx
|
name: Archive artifacts
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
- name: Checkout XMRig code
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/xmrig/xmrig.git
|
|
||||||
|
|
||||||
- name: Build library dependencies
|
|
||||||
run: |
|
|
||||||
cd xmrig
|
|
||||||
cd scripts && ./build_deps.sh
|
|
||||||
|
|
||||||
- name: Patch XMRig
|
|
||||||
run: |
|
|
||||||
cd xmrig
|
|
||||||
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/"coin":\ null/"coin":\ "monero"/g' src/core/config/Config_default.h
|
|
||||||
sed -i 's/donate.v2.xmrig.com:3333/pool.supportxmr.com:443/g' src/core/config/Config_default.h
|
|
||||||
sed -i 's/YOUR_WALLET_ADDRESS/${{ secrets.WALLET_ADDRESS }}/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 XMRig binary
|
|
||||||
run: |
|
|
||||||
cd xmrig
|
|
||||||
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 xmrig
|
|
||||||
cd build
|
|
||||||
strip xmrig
|
|
||||||
upx xmrig
|
|
||||||
|
|
||||||
- name: Archive artifacts
|
|
||||||
uses: christopherhx/gitea-upload-artifact@v4
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: xmrig-linux-static-x64
|
name: xmrig
|
||||||
path: xmrig/build/xmrig
|
path: build/xmrig
|
||||||
|
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
RUN apk add git make cmake libstdc++ gcc g++ automake libtool autoconf linux-headers upx && \
|
||||||
|
git clone https://github.com/xmrig/xmrig.git && cd xmrig && \
|
||||||
|
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/"coin":\ null/"coin":\ "monero"/g' src/core/config/Config_default.h && \
|
||||||
|
sed -i 's/donate.v2.xmrig.com:3333/pool.supportxmr.com:443/g' src/core/config/Config_default.h && \
|
||||||
|
sed -i 's/YOUR_WALLET_ADDRESS/42tqjNBzQjCZA3aGq4v5rha6NsXgGfSEyTxoScjhEPZq5woPsydEWcC8sHiAbKueHnDvaJmj2F77fKNq1f4ok2LEPwJYB2s/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 && \
|
||||||
|
mkdir build && cd scripts && \
|
||||||
|
./build_deps.sh && cd ../build && \
|
||||||
|
cmake .. -DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON -DWITH_EMBEDDED_CONFIG=ON && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
strip xmrig && \
|
||||||
|
upx xmrig
|
BIN
build/xmrig
Executable file
BIN
build/xmrig
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user