Merge branch 'xmrig:master' into master #15
This file contains 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 and Release | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt -y install git build-essential cmake automake libtool autoconf | |
- name: Clone xmrig | |
run: git clone https://github.com/xmrig/xmrig.git | |
- name: Build xmrig | |
run: | | |
mkdir xmrig/build && cd xmrig/scripts | |
./build_deps.sh && cd ../build | |
cmake .. -DXMRIG_DEPS=scripts/deps | |
make -j$(nproc) | |
- name: Calculate hash | |
id: calc_hash | |
run: | | |
echo "hash=$(sha256sum ./xmrig/build/xmrig | cut -d ' ' -f 1)" >> $GITHUB_ENV | |
- name: Get date | |
id: get_date | |
run: | | |
echo "date=$(date +'%d-%m-%Y')" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.date }}_${{ env.hash }} | |
release_name: Release ${{ env.date }}_${{ env.hash }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./xmrig/build/xmrig | |
asset_name: xmrig-linux | |
asset_content_type: application/octet-stream |