ci: install system dependencies in release action #20
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| release: | |
| types: [created] | |
| push: | |
| branches: | |
| - ci-buildbinary | |
| 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 system dependencies (Ubuntu) | |
| if: startsWith(matrix.os, 'ubuntu') && matrix.target != 'x86_64-unknown-linux-musl' | |
| run: sudo apt-get update && sudo apt-get install -y liburing-dev pkg-config libclang-dev | |
| - name: Install cross for MUSL builds | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: | | |
| cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build binary | |
| run: | | |
| if [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then | |
| cross build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }} | |
| else | |
| cargo build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }} | |
| fi | |
| 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 }} |