Skip to content

Commit

Permalink
+ Fix GitHub workflow build steps for cross-platform compatibility
Browse files Browse the repository at this point in the history
+ Add OpenSSL dependencies for Linux, macOS, and Windows
+ Fix cross-compilation for macOS ARM64 target
+ Resolve shellcheck warnings in the workflow file
  • Loading branch information
AndreasOM committed Feb 25, 2025
1 parent 29b9f23 commit 861725b
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,34 @@ jobs:
rustup update stable
rustup target add ${{ matrix.target }}
rustup default stable
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install openssl@3
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
vcpkg integrate install
vcpkg install openssl:x64-windows-static-md
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev pkg-config
- name: Build
run: cargo build --release --target ${{ matrix.target }}
run: |
if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then
SDKROOT="$(xcrun -sdk macosx --show-sdk-path)"
MACOSX_DEPLOYMENT_TARGET="$(xcrun -sdk macosx --show-sdk-platform-version)"
export SDKROOT
export MACOSX_DEPLOYMENT_TARGET
fi
cargo build --release --target ${{ matrix.target }}
- name: Prepare artifact
shell: bash
Expand Down

0 comments on commit 861725b

Please sign in to comment.