🍎 MacOS #6
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: 🍎 MacOS | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * 2' | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
macos: | |
strategy: | |
matrix: | |
toolchain: [ stable ] | |
type: [ release ] | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install GTK4 | |
run: | | |
brew install gtk4 libheif || true | |
brew link --overwrite [email protected] | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: aarch64-apple-darwin | |
- name: Enable LTO | |
run: sed -i '' 's/#lto = "thin"/lto = "thin"/g' Cargo.toml | |
- name: Build Universal Release | |
run: | | |
cargo build --release --target x86_64-apple-darwin | |
PKG_CONFIG_SYSROOT_DIR=/ cargo build --release --target aarch64-apple-darwin | |
lipo target/{x86_64,aarch64}-apple-darwin/release/czkawka_cli -create -output target/release/czkawka_cli | |
lipo target/{x86_64,aarch64}-apple-darwin/release/czkawka_gui -create -output target/release/czkawka_gui | |
lipo target/{x86_64,aarch64}-apple-darwin/release/krokiet -create -output target/release/krokiet | |
- name: Store MacOS CLI | |
uses: actions/upload-artifact@v4 | |
with: | |
name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }} | |
path: target/release/czkawka_cli | |
- name: Store MacOS GUI | |
uses: actions/upload-artifact@v4 | |
with: | |
name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }} | |
path: target/release/czkawka_gui | |
- name: Store MacOS Krokiet | |
uses: actions/upload-artifact@v4 | |
with: | |
name: krokiet-${{ runner.os }}-${{ matrix.toolchain }} | |
path: target/release/krokiet | |
- name: Build Universal Release Heif | |
run: | | |
cargo build --release --features heif --target x86_64-apple-darwin | |
cargo build --release --features heif --target aarch64-apple-darwin | |
lipo target/{x86_64,aarch64}-apple-darwin/release/czkawka_cli -create -output target/release/czkawka_cli | |
lipo target/{x86_64,aarch64}-apple-darwin/release/czkawka_gui -create -output target/release/czkawka_gui | |
lipo target/{x86_64,aarch64}-apple-darwin/release/krokiet -create -output target/release/krokiet | |
- name: Store MacOS CLI Heif | |
uses: actions/upload-artifact@v4 | |
with: | |
name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }}-heif | |
path: target/release/czkawka_cli | |
- name: Store MacOS GUI Heif | |
uses: actions/upload-artifact@v4 | |
with: | |
name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }}-heif | |
path: target/release/czkawka_gui | |
- name: Store MacOS Krokiet Heif | |
uses: actions/upload-artifact@v4 | |
with: | |
name: krokiet-${{ runner.os }}-${{ matrix.toolchain }}-heif | |
path: target/release/krokiet |