try using macOS 14 for compilation #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pre-Release for Nightly | |
on: | |
push: | |
branches: [ "nightly" ] | |
pull_request: | |
branches: [ "nightly" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
release: | |
name: Release - ${{ matrix.platform.release_for }} | |
strategy: | |
matrix: | |
platform: | |
- release_for: Windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
bin: rustyface_windows_x86.exe | |
name: rustyface-Windows-x86_64.zip | |
command: both | |
- release_for: macOS-universal | |
os: macOS-14 | |
target: universal-apple-darwin | |
bin: rustyface_macos_universal | |
name: rustyface-Darwin-universal.tar.gz | |
command: both | |
- release_for: Linux-x86_64 | |
os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
bin: rustyface_linux_x86 | |
name: rustyface_linux_x86.tar.gz | |
command: build | |
# more release targets here ... | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Install OpenSSL on macOS | |
- name: Install OpenSSL on macOS | |
if: matrix.platform.os == 'macOS-latest' | |
run: | | |
brew update | |
brew install openssl | |
# Set OpenSSL environment variables on macOS | |
- name: Set OpenSSL environment variables on macOS | |
if: matrix.platform.os == 'macOS-14' | |
run: | | |
export OPENSSL_DIR=$(brew --prefix openssl) | |
export PKG_CONFIG_PATH=$OPENSSL_DIR/lib/pkgconfig | |
echo "OPENSSL_DIR=$OPENSSL_DIR" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
# Install Rust targets for macOS universal binary | |
- name: Install Rust targets for macOS universal binary | |
if: matrix.platform.release_for == 'macOS-universal' | |
run: | | |
rustup target add x86_64-apple-darwin | |
rustup target add aarch64-apple-darwin | |
# Build binary for universal macOS target | |
- name: Build macOS universal binary | |
if: matrix.platform.release_for == 'macOS-universal' | |
run: | | |
# Build for both architectures (x86_64 and aarch64) | |
cargo build --release --target x86_64-apple-darwin | |
cargo build --release --target aarch64-apple-darwin | |
# Create a universal binary with lipo | |
lipo -create -output target/universal-apple-darwin/release/${{ matrix.platform.bin }} \ | |
target/x86_64-apple-darwin/release/${{ matrix.platform.bin }} \ | |
target/aarch64-apple-darwin/release/${{ matrix.platform.bin }} | |
# Build binary for other platforms (Windows, Linux, etc.) | |
- name: Build binary | |
if: matrix.platform.release_for != 'macOS-universal' | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: ${{ matrix.platform.command }} | |
target: ${{ matrix.platform.target }} | |
args: "--release" | |
strip: true | |
# more packaging stuff goes here ... |