-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (110 loc) · 3.89 KB
/
build.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build and Release
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
env:
MATRIX_OS: ${{ matrix.os }}
CARGO_NET_GIT_FETCH_WITH_CLI: true
RUST_MIN_STACK: 8388608
SKIP_GUEST_BUILD: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set github url and credentials
run: |
git config --global --add url."https://${{ secrets.ACCESS_TOKEN }}:x-oauth-basic@github".insteadOf ssh://git@github
git config --global --add url."https://${{ secrets.ACCESS_TOKEN }}:x-oauth-basic@github".insteadOf https://github
git config --global --add url."https://${{ secrets.ACCESS_TOKEN }}:x-oauth-basic@github".insteadOf git@github
- name: Install clang
run: |
if [[ "${RUNNER_OS}" == "macOS" ]]; then
brew install llvm
brew install openssl
brew install pkg-config
brew install libiconv
brew install libpq && brew link --force libpq
export PATH="/usr/local/opt/libpq/bin:$PATH"
export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix)/lib:$(brew --prefix)/opt/libiconv/lib
fi
if [[ "${RUNNER_OS}" == "windows-latest" ]]; then
choco install llvm
choco install openssl
choco install pkg-config
fi
if [[ "${RUNNER_OS}" == "buildjet-16vcpu-ubuntu-2004" ]]; then
sudo apt update
sudo apt install -y pkg-config libssl-dev clang
fi
- name: Install Latest Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Build-Node
id: build-node
shell: bash
run: |
cd crates/rollup
cargo build --bin node --release
binary_extension=""
if [[ "$RUNNER_OS" == "Linux" ]]; then
binary_path="spicenet-ubuntu-latest"
fi
if [[ "${RUNNER_OS}" == "Windows" ]]; then
binary_extension=".exe"
binary_path="spicenet-windows-latest${binary_extension}"
fi
if [[ "${RUNNER_OS}" == "macOS" ]]; then
if [[ "${MATRIX_OS}" == "macos-latest" ]]; then
binary_path="spicenet-macos-m1-latest"
else
binary_path="spicenet-macos-intel-latest"
fi
fi
cd ../..
mv "target/release/node${binary_extension}" "${binary_path}"
echo "::set-output name=binary_path::${binary_path}"
strip "${binary_path}"
- name: Build cli-wallet
id: build-cli-wallet
shell: bash
run: |
cd crates/rollup
cargo build --bin cli-wallet --release
binary_extension=""
if [[ "$RUNNER_OS" == "Linux" ]]; then
binary_path="cli-wallet-ubuntu-latest"
fi
if [[ "${RUNNER_OS}" == "Windows" ]]; then
binary_extension=".exe"
binary_path="cli-wallet-windows-latest${binary_extension}"
fi
if [[ "${RUNNER_OS}" == "macOS" ]]; then
if [[ "${MATRIX_OS}" == "macos-latest" ]]; then
binary_path="cli-wallet-macos-m1-latest"
else
binary_path="cli-wallet-macos-intel-latest"
fi
fi
cd ../..
mv "target/release/cli-wallet${binary_extension}" "${binary_path}"
echo "::set-output name=binary_path::${binary_path}"
strip "${binary_path}"
- name: Release Tags
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.build-node.outputs.binary_path }}
${{ steps.build-cli-wallet.outputs.binary_path }}