-
Notifications
You must be signed in to change notification settings - Fork 10
140 lines (139 loc) · 5.01 KB
/
runtime_release_linux.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
on:
release:
types: [created]
workflow_dispatch:
name: Runtime Release Linux
jobs:
blockless_runtime:
strategy:
matrix:
include:
- build: ubuntu-20.04
os: ubuntu-20.04
rust: stable
runson: ubuntu-20.04
target: x86_64-unknown-linux-musl
arch: x86_64
cross: false
- build: linux
os: linux-latest
rust: stable
runson: ubuntu-latest
target: x86_64-unknown-linux-musl
arch: x86_64
cross: false
- build: linux_arm64
os: linux-latest
runson: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
arch: aarch64
cross: false
runs-on: ${{ matrix.runson }}
steps:
- uses: actions/checkout@v2
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Edit Toml
uses: dmikey/toml-editor@master
with:
file: "bls-runtime/Cargo.toml"
key: "version"
value: "${{ steps.get_release.outputs.tag_name }}"
- name: install libssl-dev
env:
OPENSSL_DIR: /usr/local/ssl
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /usr/local/ssl
run: |
echo `pwd`
sudo apt install gcc-aarch64-linux-gnu
sudo apt-get install build-essential gcc musl-tools musl-dev make perl dkms
wget https://phoenixnap.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz\?viasf\=1 -O zlib-1.2.11.tar.gz
tar xf zlib-1.2.11.tar.gz && rm zlib-1.2.11.tar.gz
cd zlib-1.2.11
sed '394,400d' configure > _configure && mv _configure configure && chmod +x configure
mkdir build
CHOST=arm CC=/usr/bin/aarch64-linux-gnu-gcc \
AR=/usr/bin/aarch64-linux-gnu-ar \
RANLIB=/usr/bin/aarch64-linux-gnu-ranlib \
./configure --prefix=/usr/local/
make -j$(nproc)
sudo make install
cd ..
ZLIBPATH=/usr/local/
#wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
#tar -xvzf openssl-1.1.1.tar.gz
#cd openssl-1.1.1/
#./Configure linux-aarch64 \
#--cross-compile-prefix=/usr/bin/aarch64-linux-gnu- --prefix=/usr/local --with-zlib-lib=${ZLIBPATH}/lib \
#--with-zlib-include=${ZLIBPATH}/include --openssldir=/usr/local shared zlib
#make -j$(($(nproc)+1))
#sudo make install
if: startsWith(matrix.arch, 'aarch64')
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Add rust Target
run: |
rustup target add ${{ matrix.target }}
rustup target list
- name: Build runtime
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: "-C link-arg=-L/usr/local/lib"
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:/usr/local/lib"
DYLD_LIBRARY_PATH: "$DYLD_LIBRARY_PATH:/usr/local/lib"
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR: /usr/local/include
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR: /usr/local/lib
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --all-features --target ${{ matrix.target }}
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/.fingerprint
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/examples
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/build
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/incremental
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/examples
- name: Remove File
uses: JesseTG/[email protected]
with:
path: target/${{ matrix.target }}/release/deps
- name: Remove Files
run: |
rm -rf target/${{ matrix.target }}/release/*.d
rm -rf target/${{ matrix.target }}/release/*.rlib
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
type: "tar"
filename: ../../../blockless-runtime.${{ matrix.os }}.${{ matrix.arch }}.tar.gz
directory: target/${{ matrix.target }}/release
path: .
- name: upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: blockless-runtime.${{ matrix.os }}.${{ matrix.arch }}.tar.gz
asset_name: blockless-runtime.${{ matrix.os }}.${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip