From d74ad7f04e13f3712a18bd375c511e50cfb25293 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Thu, 17 Oct 2024 11:17:31 +0200 Subject: [PATCH] fix: manually set openssl config variables for aarch64 --- .github/workflows/build.yml | 47 ++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acd774e..efdfc14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,26 @@ jobs: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + + - name: Download and set up OpenSSL for cross-compilation + if: matrix.args == '--target aarch64-unknown-linux-gnu' + run: | + wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz + tar -xzf openssl-1.1.1k.tar.gz + cd openssl-1.1.1k + ./Configure linux-aarch64 --prefix=$HOME/openssl-aarch64 --cross-compile-prefix=aarch64-linux-gnu- + make -j$(nproc) + make install_sw + cd .. + echo "OPENSSL_DIR=$HOME/openssl-aarch64" >> $GITHUB_ENV + echo "OPENSSL_LIB_DIR=$HOME/openssl-aarch64/lib" >> $GITHUB_ENV + echo "OPENSSL_INCLUDE_DIR=$HOME/openssl-aarch64/include" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=$HOME/openssl-aarch64/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV + echo "OPENSSL_STATIC=1" >> $GITHUB_ENV - name: Install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-22.04' @@ -64,16 +84,37 @@ jobs: sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf pkg-config libssl-dev # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. # You can remove the one that doesn't apply to your app to speed up the workflow a bit. - + - name: Install frontend dependencies run: pnpm install - - name: Build Tauri app + - name: Build Tauri app (aarch64) + if: matrix.args == '--target aarch64-unknown-linux-gnu' + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENSSL_DIR: ${{ env.OPENSSL_DIR }} + OPENSSL_LIB_DIR: ${{ env.OPENSSL_LIB_DIR }} + OPENSSL_INCLUDE_DIR: ${{ env.OPENSSL_INCLUDE_DIR }} + PKG_CONFIG_PATH: ${{ env.PKG_CONFIG_PATH }} + PKG_CONFIG_ALLOW_CROSS: ${{ env.PKG_CONFIG_ALLOW_CROSS }} + PKG_CONFIG_SYSROOT_DIR: ${{ env.PKG_CONFIG_SYSROOT_DIR }} + OPENSSL_STATIC: ${{ env.OPENSSL_STATIC }} + with: + tagName: app-v__VERSION__ + releaseName: 'App v__VERSION__' + releaseBody: 'See the assets to download this version and install.' + releaseDraft: true + prerelease: false + args: ${{ matrix.args }} + + - name: Build Tauri app (non-aarch64) + if: matrix.args != '--target aarch64-unknown-linux-gnu' uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. + tagName: app-v__VERSION__ releaseName: 'App v__VERSION__' releaseBody: 'See the assets to download this version and install.' releaseDraft: true