From 7bbd25e36d5d332a87c563519e09e19b56c014d1 Mon Sep 17 00:00:00 2001 From: Andrea Longoni Date: Mon, 22 Apr 2024 11:14:33 +0200 Subject: [PATCH] Fix CI macOS and Linux --- .github/workflows/build-linux.yml | 6 +++++- .github/workflows/build-macos.yml | 6 +++++- .github/workflows/build-windows.yml | 2 ++ .../contributors/CONFIGURE_TDLIB.md | 19 +++++++------------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 577290b..8132e10 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -9,6 +9,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' pull_request: branches: [ main ] paths: @@ -17,6 +18,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' env: CARGO_TERM_COLOR: always @@ -58,7 +60,9 @@ jobs: path: td/ key: ${{ steps.cache-tdlib-restore.outputs.cache-primary-key }} - name: Extract TDLib - run: cp -r ./td/tdlib ./ + run: | + cp -r ./td/tdlib ./ + sudo cp ./tdlib/lib/libtdjson.so.* /usr/lib/ - name: Set environment variables run: echo "PKG_CONFIG_PATH=$(pwd)/tdlib/lib/pkgconfig" >> $GITHUB_ENV - name: Install Rust nightly diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index fbfd11c..66e37f7 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -9,6 +9,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' pull_request: branches: [ main ] paths: @@ -17,6 +18,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' env: CARGO_TERM_COLOR: always @@ -57,7 +59,9 @@ jobs: path: td/ key: ${{ steps.cache-tdlib-restore.outputs.cache-primary-key }} - name: Extract TDLib - run: cp -r ./td/tdlib ./ + run: | + cp -r ./td/tdlib ./ + cp ./tdlib/lib/libtdjson.*.dylib /usr/local/lib/ - name: Set environment variables run: | echo "PKG_CONFIG_PATH=$(pwd)/tdlib/lib/pkgconfig" >> $GITHUB_ENV diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index da68481..9ef7ac5 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -9,6 +9,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' pull_request: branches: [ main ] paths: @@ -17,6 +18,7 @@ on: - 'Cargo.toml' - 'rustfmt.toml' - 'config/**' + - '.github/workflows/**' env: CARGO_TERM_COLOR: always diff --git a/docs/configuration/contributors/CONFIGURE_TDLIB.md b/docs/configuration/contributors/CONFIGURE_TDLIB.md index f0d0e6e..830e9f5 100644 --- a/docs/configuration/contributors/CONFIGURE_TDLIB.md +++ b/docs/configuration/contributors/CONFIGURE_TDLIB.md @@ -62,12 +62,11 @@ Step 4 (not always necessary): **!The version of the library may change!** -After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.1.8.25.dylib` to the `/usr/local/lib`, `/usr/lib` or `/Users/NAME/lib`: +After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.1.8.19.dylib` to the `/usr/local/lib`, `/usr/lib`: ```bash -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/Users/NAME/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib'/usr/local/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/usr/lib/libtd' +cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.19.dylib '/usr/local/lib/' +cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.19.dylib '/usr/lib/' ``` ### Windows @@ -170,12 +169,10 @@ Step 4 (not always necessary): **!The version of the library may change!** -After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.1.8.25.dylib` to the `/usr/local/lib`, `/usr/lib` or `/Users/NAME/lib`: +After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.so.1.8.19` to the `/usr/lib`: ```bash -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/Users/NAME/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib'/usr/local/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/usr/lib/libtd' +cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.so.1.8.19 '/usr/lib/' ``` ### Linux Other (using clang) @@ -231,10 +228,8 @@ Step 4 (not always necessary): **!The version of the library may change!** -After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.1.8.25.dylib` to the `/usr/local/lib`, `/usr/lib` or `/Users/NAME/lib`: +After `cargo build`, if it fails, you may need to move explicitly the `libtdjson.so.1.8.19` to the `/usr/lib`: ```bash -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/Users/NAME/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib'/usr/local/lib/' -cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.1.8.25.dylib '/usr/lib/libtd' +cp ~/WHERE_IS_TDLIB/tdlib/lib/libtdjson.so.1.8.19 '/usr/lib/' ```