Skip to content

Build & Bundle

Build & Bundle #18

Workflow file for this run

name: "Build & Bundle"
on:
push:
branches:
- main
workflow_dispatch:
release:
types: [published]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-22.04
- windows-latest
- macos-latest
- macos-15-intel
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.platform }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ (matrix.platform == 'macos-latest') && 'aarch64-apple-darwin' || '' }}
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev libpng-dev libjpeg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libexpat1-dev libtiff-dev
- name: Setup Windows dependencies
if: runner.os == 'Windows'
run: choco install strawberryperl make --no-progress
- name: Setup MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Build Dependencies
run: |
cargo install patch-crate
cargo fetch --locked || true
cargo patch-crate --force
cargo install cargo-bundle
- name: Build & Bundle (Linux)
if: runner.os == 'Linux'
run: |
cargo bundle --bin plumeimpactor --package plumeimpactor --release --format appimage
- name: Build & Bundle (macOS)
if: runner.os == 'macOS'
run: |
cargo bundle --bin plumeimpactor --package plumeimpactor --release --format osx
mkdir build
cp -R target/release/bundle/*/*.app build/
ln -s /Applications build/Applications
hdiutil create -volname plumeimpactor -srcfolder build -ov -format UDZO target/release/bundle/plumeimpactor.dmg
- name: Build & Bundle (Windows)
if: runner.os == 'Windows'
run: |
cargo bundle --bin plumeimpactor --package plumeimpactor --release --format msi
- name: Upload Bundles
uses: actions/upload-artifact@v4
with:
name: plumeimpactor-${{ matrix.platform }}
path: |
target/release/bundle/*/*.{rpm,deb,AppImage,dmg,exe,msi}