Skip to content

workflow: add rust targets #10

workflow: add rust targets

workflow: add rust targets #10

Workflow file for this run

name: Build MacOS Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
save-always: true
- name: Rustup
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
- name: Build x86_64
run: cargo build --target=x86_64-apple-darwin -F ${{ vars.CARGO_FEATURES }} --release
- name: Build aarch64
run: cargo build --target=aarch64-apple-darwin -F ${{ vars.CARGO_FEATURES }} --release
- name: Lipo
run: mkdir -p target/release ; lipo -create -output target/release/loungy target/x86_64-apple-darwin/release/loungy target/aarch64-apple-darwin/release/loungy
- name: Install Packer
run: cargo install cargo-packager --locked
- name: Package
run: cargo packager --release
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
target/release/*.dmg