Skip to content

Commit

Permalink
refact: ci, bridge (rustdesk#9899)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou authored Nov 12, 2024
1 parent 0aa98ea commit ab89d84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 54 deletions.
56 changes: 6 additions & 50 deletions .github/workflows/bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,15 @@ jobs:
matrix:
job:
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-20.04,
extra-build-args: "",
}
- {
target: aarch64-apple-darwin,
os: macos-latest,
arch: aarch64,
target: x86_64-apple-darwin,
os: macos-13,
arch: x86_64,
extra-build-args: "",
}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install prerequisites
if: matrix.job.os == 'ubuntu-20.04'
run: |
sudo apt-get install ca-certificates -y
sudo apt-get update -y
sudo apt-get install -y \
clang \
cmake \
curl \
gcc \
git \
g++ \
libclang-10-dev \
libgtk-3-dev \
llvm-10-dev \
nasm \
ninja-build \
pkg-config \
wget
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
Expand Down Expand Up @@ -85,18 +60,10 @@ jobs:
- name: Run flutter rust bridge
run: |
case ${{ matrix.job.os }} in
ubuntu-20.04)
~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart
;;
macos-latest)
~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h
~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/ios/Runner/bridge_generated.h
;;
esac
~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h
cp ./flutter/macos/Runner/bridge_generated.h ./flutter/ios/Runner/bridge_generated.h
- name: Upload Artifact(ubuntu)
if: matrix.job.os == 'ubuntu-20.04'
- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: bridge-artifact
Expand All @@ -105,16 +72,5 @@ jobs:
./src/bridge_generated.io.rs
./flutter/lib/generated_bridge.dart
./flutter/lib/generated_bridge.freezed.dart
- name: Upload Artifact(macos)
if: matrix.job.os == 'macos-latest'
uses: actions/upload-artifact@master
with:
name: bridge-artifact-macos
path: |
./src/bridge_generated.rs
./src/bridge_generated.io.rs
./flutter/lib/generated_bridge.dart
./flutter/lib/generated_bridge.freezed.dart
./flutter/macos/Runner/bridge_generated.h
./flutter/ios/Runner/bridge_generated.h
8 changes: 4 additions & 4 deletions .github/workflows/flutter-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ jobs:
- name: Restore bridge files
uses: actions/download-artifact@master
with:
name: bridge-artifact-macos
name: bridge-artifact
path: ./

- name: Build rustdesk
Expand Down Expand Up @@ -538,7 +538,7 @@ jobs:
- name: Restore bridge files
uses: actions/download-artifact@master
with:
name: bridge-artifact-macos
name: bridge-artifact
path: ./

- name: Build rustdesk lib
Expand Down Expand Up @@ -593,7 +593,7 @@ jobs:
- name: Restore bridge files
uses: actions/download-artifact@master
with:
name: bridge-artifact-macos
name: bridge-artifact
path: ./

- name: Build rustdesk lib
Expand Down Expand Up @@ -728,7 +728,7 @@ jobs:
- name: Restore bridge files
uses: actions/download-artifact@master
with:
name: bridge-artifact-macos
name: bridge-artifact
path: ./

- name: Setup vcpkg with Github Actions binary cache
Expand Down

0 comments on commit ab89d84

Please sign in to comment.