Skip to content

0.8.0

0.8.0 #236

Workflow file for this run

name: Build-macOS
on:
push:
branches:
- release
tags:
- "*"
pull_request:
branches:
- release
- master
workflow_dispatch:
jobs:
build:
name: Rust project
runs-on: macos-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
MACOSX_DEPLOYMENT_TARGET: "10.10"
CARGO_INCREMENTAL: 0
steps:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.6
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew unlink pkg-config@0.29.2 || true
brew install coreutils pkgconfig libarchive llvm@18
echo PKG_CONFIG_PATH=$(brew ls libarchive | grep .pc$ | sed 's|/libarchive.pc||') >> $GITHUB_ENV
- name: Install cargo-packager
run: (cargo install cargo-packager || true)
- name: Set build specific env vars
run: |
echo CC=${HOMEBREW_PREFIX}/opt/llvm@18/bin/clang >> $GITHUB_ENV
echo CXX=${HOMEBREW_PREFIX}/opt/llvm@18/bin/clang++ >> $GITHUB_ENV
echo AR=${HOMEBREW_PREFIX}/opt/llvm@18/bin/llvm-ar >> $GITHUB_ENV
echo CFLAGS='-flto=full -O3' >> $GITHUB_ENV
echo CXXFLAGS='-flto=full -O3' >> $GITHUB_ENV
echo RUSTFLAGS="-Zshare-generics=true -Clinker-plugin-lto -Clinker=$PWD/scripts/linker-shim.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/llvm@18/bin/ld64.lld" >> $GITHUB_ENV
- uses: r7kamura/rust-problem-matchers@v1
- name: Build
run: cargo build --release
- name: Test
run: cargo test --release --features="leaky-api" -- --nocapture
- name: Run cargo-packager
run: cargo packager --release --formats app
- name: Run bundle-dylibs.sh
run: ./scripts/bundle-dylibs.sh target/release/moss.app
- name: Re-sign libs
run: codesign --force -s - target/release/moss.app/Contents/Frameworks/*
- uses: actions/upload-artifact@v4
with:
name: macos
path: |
target/release/moss
target/release/moss.app