-
Notifications
You must be signed in to change notification settings - Fork 17
94 lines (79 loc) · 2.21 KB
/
rust.yml
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 CI
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: linux-x86_64
suffix: ''
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: linux-aarch64
suffix: ''
- target: x86_64-apple-darwin
os: macos-latest
name: macos
suffix: ''
# - target: x86_64-pc-windows-msvc
# os: windows-latest
# name: windows
# suffix: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/[email protected]
- uses: Vampire/[email protected]
with:
additional-packages:
git
clang
curl
libssl-dev
llvm
libudev-dev
make
protobuf-compile
if: matrix.os == 'windows-latest'
- uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: nightly-2023-05-20
override: true
- name: Add WASM target
run: |
rustup target add wasm32-unknown-unknown
- uses: actions/[email protected]
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/[email protected]
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/[email protected]
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/[email protected]
with:
command: build
args: '--release'
- name: Package
shell: bash
run: |
cd target/release
tar czvf ../../poscan-consensus-${{ matrix.name }}.tar.gz poscan-consensus${{ matrix.suffix }}
cd -
- name: Publish
uses: softprops/[email protected]
with:
files: "poscan-consensus-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}