Skip to content

v0.0.4(Deprecated)

v0.0.4(Deprecated) #6

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
build-release-assets:
name: build-release-assets
# This permissions block is the required change
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install MUSL toolchain (Ubuntu)
if: matrix.target == 'x86_64-unknown-linux-musl' && startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Configure MUSL environment
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV
echo "AR_x86_64_unknown_linux_musl=ar" >> $GITHUB_ENV
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV
- name: Build binary
run: cargo build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }}
env:
RUSTFLAGS: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && '-C strip=symbols -C target-cpu=native' || matrix.target == 'x86_64-unknown-linux-musl' && '-C strip=symbols -C target-feature=+crt-static -C default-linker-libraries -Clink-arg=-static-libgcc' || '-C strip=symbols' }}
- name: Prepare artifact
run: |
set -e
bin_name="reth-bsc"
tag_name="${{ github.ref_name }}"
asset_name="${bin_name}-${tag_name}-${{ matrix.target }}"
mkdir -p "${asset_name}"
cp "target/${{ matrix.target }}/maxperf/${bin_name}" "${asset_name}/"
tar -czvf "${asset_name}.tar.gz" "${asset_name}"
echo "ASSET_NAME=${asset_name}.tar.gz" >> $GITHUB_ENV
- name: Upload release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
uses: softprops/action-gh-release@v1
with:
files: ${{ env.ASSET_NAME }}