-
Notifications
You must be signed in to change notification settings - Fork 61
97 lines (82 loc) · 2.84 KB
/
binaries-x86-64.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
name: Build binaries (x86-64)
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
- release/*
env:
rust_stable: 1.68.2
jobs:
build:
name: Build binaries (x86-64)
env:
# `-D warnings` means any warnings emitted will cause build to fail
RUSTFLAGS: "-D warnings -C opt-level=z -C target-cpu=x86-64 -C debuginfo=1"
X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Musl
run: |
sudo apt-get install musl musl-tools
musl-gcc -v
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_stable }}
components: rustfmt, clippy
target: x86_64-unknown-linux-musl
override: true
- name: Set build target for cache key
run: echo "CARGO_BUILD_TARGET=x86_64-unknown-linux-musl" >> $GITHUB_ENV
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Check lockfile
uses: actions-rs/cargo@v1
with:
command: tree
args: --locked
- name: Install openssl ( Windows only )
if: runner.os == 'Windows'
run: |
vcpkg install openssl:x64-windows openssl:x64-windows-static
vcpkg list
vcpkg integrate install
- name: Build binaries
run: |
cargo build --features static-openssl --target x86_64-unknown-linux-musl
(cd core/gftp && cargo build --bin gftp -p gftp --features bin --target x86_64-unknown-linux-musl)
(cd golem_cli && cargo build --bin golemsp -p golemsp --target x86_64-unknown-linux-musl)
(cd agent/provider && cargo build --bin ya-provider -p ya-provider --target x86_64-unknown-linux-musl)
(cd exe-unit && cargo build --bin exe-unit -p ya-exe-unit --features openssl/vendored --target x86_64-unknown-linux-musl)
- name: Copy binaries
shell: bash
run: |
mkdir build
if [ "$RUNNER_OS" == "Linux" ]; then
cp target/x86_64-unknown-linux-musl/debug/{yagna,ya-provider,exe-unit,golemsp,gftp} build
strip -x build/*
elif [ "$RUNNER_OS" == "macOS" ]; then
cp target/debug/{yagna,gftp} build
strip -x build/*
elif [ "$RUNNER_OS" == "Windows" ]; then
cp target/debug/{yagna,gftp}.exe build
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Upload binaries
uses: actions/upload-artifact@v1
with:
name: Yagna ${{ runner.os }}
path: build