Merge pull request #134 from hl-archive-node/fix-block-source-startup… #6
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 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 }} |