Skip to content

Commit

Permalink
fix: manually set openssl config variables for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
alenmestrov committed Oct 17, 2024
1 parent 3e8e8da commit d74ad7f
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit d74ad7f

Please sign in to comment.