-
Notifications
You must be signed in to change notification settings - Fork 36
69 lines (61 loc) · 2.5 KB
/
Release.yml
File metadata and controls
69 lines (61 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 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 }}