Fix: use full paths for cargo to work across all build steps
This commit is contained in:
parent
8788ad7df2
commit
c41c201ac8
2 changed files with 26 additions and 37 deletions
|
|
@ -8,6 +8,10 @@ on:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_HOME: /root/.cargo
|
||||||
|
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-bundle:
|
build-bundle:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
|
|
@ -39,10 +43,10 @@ jobs:
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
source ~/.cargo/env
|
echo "/root/.cargo/bin" >> $GITHUB_PATH
|
||||||
rustup target add x86_64-unknown-linux-gnu
|
/root/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
/root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
|
||||||
rustup target add x86_64-pc-windows-gnu
|
/root/.cargo/bin/rustup target add x86_64-pc-windows-gnu
|
||||||
|
|
||||||
- name: Install cross-compilation dependencies
|
- name: Install cross-compilation dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -90,57 +94,47 @@ jobs:
|
||||||
# Build botserver for all platforms
|
# Build botserver for all platforms
|
||||||
# ============================================
|
# ============================================
|
||||||
- name: Build botserver - Linux x86_64
|
- name: Build botserver - Linux x86_64
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target x86_64-unknown-linux-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Build botserver - Linux ARM64
|
- name: Build botserver - Linux ARM64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target aarch64-unknown-linux-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Build botserver - Windows x86_64
|
- name: Build botserver - Windows x86_64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target x86_64-pc-windows-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target x86_64-pc-windows-gnu
|
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Build botui for all platforms
|
# Build botui for all platforms
|
||||||
# ============================================
|
# ============================================
|
||||||
- name: Build botui - Linux x86_64
|
- name: Build botui - Linux x86_64
|
||||||
run: |
|
run: |
|
||||||
source ~/.cargo/env
|
|
||||||
cd ../botui
|
cd ../botui
|
||||||
cargo build --release --locked --target x86_64-unknown-linux-gnu
|
/root/.cargo/bin/cargo build --release --locked --target x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
- name: Build botui - Linux ARM64
|
- name: Build botui - Linux ARM64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: |
|
||||||
source ~/.cargo/env
|
|
||||||
cd ../botui
|
cd ../botui
|
||||||
cargo build --release --locked --target aarch64-unknown-linux-gnu
|
/root/.cargo/bin/cargo build --release --locked --target aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
- name: Build botui - Windows x86_64
|
- name: Build botui - Windows x86_64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
||||||
run: |
|
run: |
|
||||||
source ~/.cargo/env
|
|
||||||
cd ../botui
|
cd ../botui
|
||||||
cargo build --release --locked --target x86_64-pc-windows-gnu
|
/root/.cargo/bin/cargo build --release --locked --target x86_64-pc-windows-gnu
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Build botbook documentation
|
# Build botbook documentation
|
||||||
# ============================================
|
# ============================================
|
||||||
- name: Install mdBook
|
- name: Install mdBook
|
||||||
run: |
|
run: |
|
||||||
source ~/.cargo/env
|
|
||||||
if ! command -v mdbook &> /dev/null; then
|
if ! command -v mdbook &> /dev/null; then
|
||||||
cargo install mdbook
|
/root/.cargo/bin/cargo install mdbook
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build botbook
|
- name: Build botbook
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_HOME: /root/.cargo
|
||||||
|
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
|
|
@ -33,10 +37,10 @@ jobs:
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
source ~/.cargo/env
|
echo "/root/.cargo/bin" >> $GITHUB_PATH
|
||||||
rustup target add x86_64-unknown-linux-gnu
|
/root/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
/root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
|
||||||
rustup target add x86_64-pc-windows-gnu
|
/root/.cargo/bin/rustup target add x86_64-pc-windows-gnu
|
||||||
|
|
||||||
- name: Install cross-compilation dependencies
|
- name: Install cross-compilation dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -49,27 +53,18 @@ jobs:
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
run: sudo cp /opt/gbo/bin/system/.env .
|
run: sudo cp /opt/gbo/bin/system/.env .
|
||||||
|
|
||||||
# Linux x86_64
|
|
||||||
- name: Build Linux x86_64
|
- name: Build Linux x86_64
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target x86_64-unknown-linux-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
# Linux ARM64
|
|
||||||
- name: Build Linux ARM64
|
- name: Build Linux ARM64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target aarch64-unknown-linux-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
# Windows x86_64
|
|
||||||
- name: Build Windows x86_64
|
- name: Build Windows x86_64
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
|
||||||
run: |
|
run: /root/.cargo/bin/cargo build --release --locked --target x86_64-pc-windows-gnu
|
||||||
source ~/.cargo/env
|
|
||||||
cargo build --release --locked --target x86_64-pc-windows-gnu
|
|
||||||
|
|
||||||
- name: Prepare release artifacts
|
- name: Prepare release artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue