Skip to content

Rust Release Build

Rust Release Build #13

Workflow file for this run

name: Rust Release Build
on: workflow_dispatch
env:
SHELL: /bin/bash
CARGO_TERM_COLOR: never
SCCACHE_GHA_ENABLED: "true"
CCACHE: sccache
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
include:
- os: windows-latest
id: windows
target: x86_64-pc-windows-msvc
- os: macos-13
id: macos
target: x86_64-apple-darwin
- os: ubuntu-latest
id: linux
target: x86_64-unknown-linux-gnu
env:
TARGET: ${{ matrix.target }}
SCCACHE_CACHE_SIZE: 3G
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install LLVM
if: matrix.id == 'linux'
uses: KyleMayes/install-llvm-action@v1
with:
version: "17.0"
- name: Setup Dependencies
uses: ./.github/actions/setup
with:
os: ${{ matrix.id }}
cache-id: release-${{ matrix.id }}
- name: Build Windows
if: matrix.id == 'windows'
env:
MOZTOOLS_PATH: ${{ github.workspace }}\\target\\dependencies\\moztools-4.0
MOZ_LTO: full
CC: clang-cl
CXX: clang-cl
AR: llvm-lib
LINKER: lld-link
CFLAGS: /clang:-flto=thin /clang:-fuse-ld=lld-link
CXXFLAGS: /clang:-flto=thin /clang:-fuse-ld=lld-link
RUSTFLAGS: -Clinker-plugin-lto -Clinker=lld-link -Clink-arg=/verbose
run: |
just build-release -vv --target $env:TARGET
Rename-Item -Path .\target\$env:TARGET\release\cli.exe -NewName spiderfire.exe
- name: Build MacOS
if: matrix.id == 'macos'
env:
CC: clang
CXX: clang++
RUSTC_WRAPPER: sccache
run: |
just build-release -v --target $TARGET
mv ./target/$TARGET/release/cli ./target/$TARGET/release/spiderfire
- name: Build Linux
if: matrix.id == 'linux'
env:
MOZ_LTO: full
CC: clang
CFLAGS: -flto -fuse-ld=lld
CXX: clang++
CXXFLAGS: -flto -fuse-ld=lld
LDFLAGS: -fuse-ld=lld
RUSTC_WRAPPER: sccache
RUSTFLAGS: -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld
run: |
just build-release -v --target $TARGET
mv ./target/$TARGET/release/cli ./target/$TARGET/release/spiderfire
- name: Upload Executables as Artifacts
uses: actions/upload-artifact@v3
with:
name: spiderfire-${{ github.sha }}-${{ matrix.id }}
path: target/${{ matrix.target }}/release/spiderfire${{ matrix.id == 'windows' && '.exe' || '' }}
if-no-files-found: error