(Cross)Compile AppFlowy Cloud with Ubuntu #22
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
name: (Cross)Compile AppFlowy Cloud with Ubuntu | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "AppFlowy Cloud tag" | |
required: true | |
type: string | |
workflow_call: | |
inputs: | |
tag: | |
description: "AppFlowy Cloud tag" | |
required: true | |
type: string | |
jobs: | |
cross-compile-appflowy-cloud: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
- target: aarch64-unknown-linux-musl | |
steps: | |
- name: Checkout AppFlowy Cloud | |
uses: actions/checkout@v4 | |
with: | |
repository: AppFlowy-IO/AppFlowy-Cloud | |
ref: ${{ inputs.tag }} | |
- name: Prepare | |
run: | | |
sudo apt install -y musl-tools protobuf-compiler | |
wget https://musl.cc/aarch64-linux-musl-cross.tgz | |
tar -xvzf aarch64-linux-musl-cross.tgz | |
mkdir .cargo | |
echo [target.aarch64-unknown-linux-musl] >> .cargo/config.toml | |
echo 'linker = "./aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc"' >> .cargo/config.toml | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: "${{ matrix.target }}" | |
- name: Setup Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build Appflowy Cloud | |
run: cargo build --verbose --locked --release --bin appflowy_cloud --target ${{ matrix.target }} | |
- name: Upload Appflowy Cloud | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}-appflowy_cloud-${{ inputs.tag }} | |
path: target/${{ matrix.target }}/release/appflowy_cloud | |
- name: Build Admin Fronted | |
run: | | |
cd admin_frontend | |
sed -i 's/reqwest = "0.11.27"/reqwest = { version = "0.11.27", features = ["native-tls-vendored"] }/g' Cargo.toml | |
cargo build --verbose --locked --release --bin admin_frontend --target ${{ matrix.target }} | |
- name: Upload Admin Fronted | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}-admin_frontend-${{ inputs.tag }} | |
path: target/${{ matrix.target }}/release/admin_frontend |