Skip to content

Wait my workflow

Wait my workflow #2993

Workflow file for this run

name: Build binaries (x86-64)
on:
workflow_dispatch:
inputs:
rust_flags:
description: 'Rust flags'
required: true
default: '-C opt-level=z -C target-cpu=x86-64 -C debuginfo=1'
rust_version:
description: 'Rust version'
required: true
default: '1.71.1'
strip_binaries:
description: 'Strip binaries'
required: true
default: 'true'
possible_values: ['true', 'false']
push:
branches:
- master
- release/*
- p2p-stability
- '**/all-tests'
- '**/integration-tests'
pull_request:
branches:
- master
- release/*
- p2p-stability
jobs:
build:
name: Build binaries (x86-64)
env:
RUSTFLAGS: ${{ github.event.inputs.rust_flags || '-C opt-level=z -C target-cpu=x86-64 -C debuginfo=1' }}
runs-on: [ yagna-builder, ubuntu-22.04 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set input variables
id: variables
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
echo "rust_version=${{ github.event.inputs.rust_version || '1.71.1' }}" >> $GITHUB_OUTPUT
echo "rust_flags_md5=`echo ${RUSTFLAGS} | md5sum | head -c 10`" >> $GITHUB_OUTPUT
- name: Musl
run: |
sudo apt-get -y install musl musl-tools
musl-gcc -v
- name: Install Rust ${{ steps.variables.outputs.rust_version }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.variables.outputs.rust_version }}
components: rustfmt, clippy
targets: x86_64-unknown-linux-musl
- name: Load local cache
id: cache_action
env:
cache_dir: /opt/yagna_cache/${{ steps.variables.outputs.rust_version }}/${{ steps.variables.outputs.branch }}/${{ steps.variables.outputs.rust_flags_md5 }}/binaries_x86/target
run: |
# Uncomment line if you want need to clear cache
# rm -rf "$cache_dir"
cp -rp "$cache_dir" target || echo "No local cache found"
echo "cache_dir=$cache_dir" >> $GITHUB_OUTPUT
- name: Build binaries
run: |
cargo build --features static-openssl --target x86_64-unknown-linux-musl -p yagna -p ya-exe-unit -p gftp -p golemsp -p ya-provider
- name: Move target binaries
run: |
mkdir build
mv target/x86_64-unknown-linux-musl/debug/{yagna,ya-provider,exe-unit,golemsp,gftp} build
- name: Strip binaries
if: ${{ github.event.inputs.strip_binaries != 'false' }}
run: |
strip -x build/*
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: Yagna ${{ runner.os }}
path: build
- name: Save local cache
run: |
# copy to /opt/yagna_cache and preserve permissions and timestamps
rsync -a --delete --mkpath target/ "${{ steps.cache_action.outputs.cache_dir }}"