forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 35
94 lines (81 loc) · 2.75 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (81 loc) · 2.75 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Release nanoreth
on:
push:
tags:
- "v*"
- "nb-*"
permissions:
contents: write
jobs:
build-amd64:
name: Build x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: ""
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install Rust
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo
- name: Build
run: |
cargo build --locked --release --target x86_64-unknown-linux-gnu --bin reth-hl --features "jemalloc,asm-keccak,min-debug-logs"
- name: Prepare package
shell: bash
run: |
set -euo pipefail
BIN_NAME="reth-hl"
TAG_NAME="${GITHUB_REF_NAME}"
VERSION="${TAG_NAME#v}"
TARGET="x86_64-unknown-linux-gnu"
OUTDIR="dist"
mkdir -p "$OUTDIR"
BIN_PATH="target/$TARGET/release/${BIN_NAME}"
PKG_NAME="nanoreth-${TARGET}.tar.gz"
strip -s "$BIN_PATH" || true
tar -C "target/$TARGET/release" -czf "$OUTDIR/$PKG_NAME" "$BIN_NAME"
echo "PKG_PATH=$OUTDIR/$PKG_NAME" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: x86_64-unknown-linux-gnu
path: ${{ env.PKG_PATH }}
release:
name: Create Release
needs: [build-amd64]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: dist
- name: Gather files
id: gather
run: |
echo "files<<EOF" >> $GITHUB_OUTPUT
find dist -type f -maxdepth 2 -print >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
tag_name: ${{ github.ref_name }}
files: ${{ steps.gather.outputs.files }}
generate_release_notes: true
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}