Runtime Release Linux #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |