-
Notifications
You must be signed in to change notification settings - Fork 7
92 lines (81 loc) · 2.49 KB
/
release.yml
File metadata and controls
92 lines (81 loc) · 2.49 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
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build-release:
name: build-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build release binary
run: RUSTFLAGS="-C target-cpu=native" cargo build --target ${{ matrix.target }} --profile release --features jemalloc,asm-keccak --bin ev-reth
- name: Create tarball
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
tar czf ev-reth-${{ matrix.target }}.tar.gz ev-reth
mv ev-reth-${{ matrix.target }}.tar.gz ../../../
- name: Create zip
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cd target/${{ matrix.target }}/release
Compress-Archive -Path ev-reth.exe -DestinationPath ../../../ev-reth-${{ matrix.target }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: ev-reth-${{ matrix.target }}
path: |
ev-reth-*.tar.gz
ev-reth-*.zip
create-release:
name: create-release
needs: build-release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
pattern: ev-reth-*
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
draft: false
prerelease: false
generate_release_notes: true
files: |
artifacts/ev-reth-*.tar.gz
artifacts/ev-reth-*.zip