Skip to content

CI

CI #6

Workflow file for this run

name: CI
on: workflow_dispatch
env:
binary: quartz
CARGO_TERM_COLOR: always
jobs:
# Build for Linux
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: ${{ env.use_git_lfs }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: install dependencies
run: |
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-gnu
- name: Prepare package
run: |
mkdir linux
cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
cp -r assets linux/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
- name: Package as a zip
working-directory: ./linux
run: |
zip --recurse-paths ../${{ env.binary }}.zip .
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}.zip
name: linux
retention-days: 30
# Build for Windows
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
lfs: ${{ env.use_git_lfs }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Build
run: |
cargo build --release --target x86_64-pc-windows-msvc
- name: Prepare package
run: |
mkdir windows
cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
mkdir assets -ea 0 # create the assets directory if it does not exist, it will get ignored in the zip if empty
cp -r assets windows/
- name: Package as a zip
run: |
Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}.zip
name: windows
retention-days: 30
# Build for MacOS x86_64
build-macOS-intel:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
lfs: ${{ env.use_git_lfs }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
- name: Environment Setup
run: |
export CFLAGS="-fno-stack-check"
export MACOSX_DEPLOYMENT_TARGET="10.9"
- name: Build
run: |
cargo build --release --target x86_64-apple-darwin
- name: Prepare Package
run: |
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}-macOS-intel.dmg
name: macOS-intel
retention-days: 30
# Build for MacOS Apple Silicon
build-macOS-apple-silicon:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
lfs: ${{ env.use_git_lfs }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Environment
# macOS 11 was the first version to support ARM
run: |
export MACOSX_DEPLOYMENT_TARGET="11"
- name: Build
run: |
cargo build --release --target aarch64-apple-darwin
- name: Prepare Package
run: |
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}-macOS-apple-silicon.dmg
name: macOS-apple-silicon
retention-days: 30