2020-04-09 01:29:17 +02:00
|
|
|
# CD GitHub Actions workflow for Monolith
|
|
|
|
|
2020-04-05 20:29:06 +02:00
|
|
|
name: CD
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
2020-04-09 01:29:17 +02:00
|
|
|
types:
|
|
|
|
- created
|
2020-04-05 20:29:06 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-04-09 01:29:17 +02:00
|
|
|
|
2020-04-05 20:29:06 +02:00
|
|
|
windows:
|
2020-04-18 19:44:26 +02:00
|
|
|
runs-on: windows-2019
|
2020-04-05 20:29:06 +02:00
|
|
|
steps:
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
- name: Checkout the repository
|
2020-04-09 01:29:17 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-07-14 01:09:01 +02:00
|
|
|
- name: Build the executable
|
2020-04-09 01:29:17 +02:00
|
|
|
run: cargo build --release
|
2020-04-05 20:29:06 +02:00
|
|
|
- uses: Shopify/upload-to-release@1.0.0
|
|
|
|
with:
|
|
|
|
name: monolith.exe
|
2020-04-09 01:29:17 +02:00
|
|
|
path: target\release\monolith.exe
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
gnu_linux_armhf:
|
2020-04-18 19:44:26 +02:00
|
|
|
runs-on: ubuntu-18.04
|
2020-04-09 01:29:17 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Prepare cross-platform environment
|
|
|
|
run: |
|
2021-06-20 12:43:32 +02:00
|
|
|
sudo mkdir -p /cross-build
|
2020-05-12 09:29:32 +02:00
|
|
|
sudo touch /etc/apt/sources.list.d/armhf.list
|
|
|
|
echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main" | sudo tee -a /etc/apt/sources.list.d/armhf.list
|
2020-04-18 19:44:26 +02:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
|
|
|
|
sudo apt-get download libssl1.1:armhf libssl-dev:armhf
|
2021-06-20 12:43:32 +02:00
|
|
|
sudo dpkg -x libssl1.1*.deb /cross-build
|
|
|
|
sudo dpkg -x libssl-dev*.deb /cross-build
|
2020-04-09 01:29:17 +02:00
|
|
|
rustup target add arm-unknown-linux-gnueabihf
|
2021-06-20 12:43:32 +02:00
|
|
|
echo "C_INCLUDE_PATH=/cross-build/usr/include" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_INCLUDE_DIR=/cross-build/usr/include/arm-linux-gnueabihf" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_LIB_DIR=/cross-build/usr/lib/arm-linux-gnueabihf" >> $GITHUB_ENV
|
2020-12-27 16:52:47 +01:00
|
|
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
2021-06-20 12:43:32 +02:00
|
|
|
echo "RUSTFLAGS=-C linker=arm-linux-gnueabihf-gcc -L/usr/arm-linux-gnueabihf/lib -L/cross-build/usr/lib/arm-linux-gnueabihf -L/cross-build/lib/arm-linux-gnueabihf" >> $GITHUB_ENV
|
2020-04-18 19:44:26 +02:00
|
|
|
- name: Build the executable
|
2020-05-01 01:45:44 +02:00
|
|
|
run: cargo build --release --target=arm-unknown-linux-gnueabihf
|
2020-04-18 19:44:26 +02:00
|
|
|
- name: Attach artifact to the release
|
|
|
|
uses: Shopify/upload-to-release@1.0.0
|
2020-04-09 01:29:17 +02:00
|
|
|
with:
|
|
|
|
name: monolith-gnu-linux-armhf
|
|
|
|
path: target/arm-unknown-linux-gnueabihf/release/monolith
|
2020-04-05 20:29:06 +02:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2020-06-19 13:44:57 +02:00
|
|
|
|
2021-06-20 12:43:32 +02:00
|
|
|
gnu_linux_aarch64:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Prepare cross-platform environment
|
|
|
|
run: |
|
|
|
|
sudo mkdir -p /cross-build
|
|
|
|
sudo touch /etc/apt/sources.list.d/arm64.list
|
|
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main" | sudo tee -a /etc/apt/sources.list.d/arm64.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
|
|
|
|
sudo apt-get download libssl1.1:arm64 libssl-dev:arm64
|
|
|
|
sudo dpkg -x libssl1.1*.deb /cross-build
|
|
|
|
sudo dpkg -x libssl-dev*.deb /cross-build
|
|
|
|
rustup target add aarch64-unknown-linux-gnu
|
|
|
|
echo "C_INCLUDE_PATH=/cross-build/usr/include" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_INCLUDE_DIR=/cross-build/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_LIB_DIR=/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
|
|
|
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
|
|
|
echo "RUSTFLAGS=-C linker=aarch64-linux-gnu-gcc -L/usr/aarch64-linux-gnu/lib -L/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
|
|
|
|
- name: Build the executable
|
|
|
|
run: cargo build --release --target=aarch64-unknown-linux-gnu
|
|
|
|
- name: Attach artifact to the release
|
|
|
|
uses: Shopify/upload-to-release@1.0.0
|
|
|
|
with:
|
|
|
|
name: monolith-gnu-linux-aarch64
|
|
|
|
path: target/aarch64-unknown-linux-gnu/release/monolith
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2020-06-19 13:44:57 +02:00
|
|
|
gnu_linux_x86_64:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v2
|
2020-07-14 01:09:01 +02:00
|
|
|
- name: Build the executable
|
2020-06-19 13:44:57 +02:00
|
|
|
run: cargo build --release
|
|
|
|
- uses: Shopify/upload-to-release@1.0.0
|
|
|
|
with:
|
|
|
|
name: monolith-gnu-linux-x86_64
|
|
|
|
path: target/release/monolith
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|