name: 🏗️ Build For MacOS
on:
workflow_call:
jobs:
build-macos:
name: 🍎 Build macOS For ${{ matrix.target }}
runs-on: macos-latest
strategy:
matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin]
steps:
- name: 🔍 Checkout Code
uses: actions/checkout@v3
- name: ⚙️ Set Up Rust for ${{ matrix.target }}
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
components: rustfmt, clippy
- name: 🛠️ Build Binary
run: cargo build --target ${{ matrix.target }} --release
- name: 📦 Package Artifacts (tar.gz)
shell: bash
run: |
mkdir -p release
cp target/${{ matrix.target }}/release/getquotes release/
tar -czvf getquotes-${{ matrix.target }}.tar.gz -C release getquotes -C ../ man/getquotes.1 LICENSE completions/ config.schema.json
- name: 🚢 Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.target }}
path: getquotes-${{ matrix.target }}.tar.gz