Build #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
- release | |
- workflow_dispatch | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: macos-latest # ARM | |
target: "aarch64-apple-darwin" | |
name: macos | |
arch: arm | |
ext: "" | |
- platform: macos-latest # Intel | |
target: "x86_64-apple-darwin" | |
name: macos | |
arch: x86_64 | |
ext: "" | |
- platform: ubuntu-22.04 | |
target: "" | |
name: linux | |
arch: x86_64 | |
ext: "" | |
- platform: windows-latest | |
target: "" | |
name: windows | |
arch: x86_64 | |
ext: ".exe" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rustup and Cargo | |
run: | | |
rustup update nightly | |
rustup default nightly | |
rustup component add rust-src --toolchain nightly | |
- uses: Swatinem/rust-cache@v2 | |
# Size Profile | |
- name: Build - Size Opt. | |
if: matrix.name != 'windows' | |
run: ./scripts/build/size.sh "${{ matrix.target }}" | |
- name: Build - Size Opt. | |
if: matrix.name == 'windows' | |
run: ./scripts/build/size.ps1 | |
- name: Upload Build - Size Opt. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lang_cli-${{ matrix.name }}-${{ matrix.arch }}-size | |
path: target/${{ matrix.target != '' && format('{0}/', matrix.target) || ''}}release-size/lang_cli${{ matrix.ext }} | |
# Speed Profile | |
- name: Build - Speed Opt. | |
if: matrix.name != 'windows' | |
env: | |
CPU_NATIVE: ${{ matrix.name }} != "macos" && ${{ matrix.arch }} != "x86_64" | |
run: ./scripts/build/speed.sh "${{ matrix.target }}" | |
- name: Build - Speed Opt. | |
if: matrix.name == 'windows' | |
run: ./scripts/build/speed.ps1 | |
- name: Upload Build - Speed Opt. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lang_cli-${{ matrix.name }}-${{ matrix.arch }} | |
path: target/${{ matrix.target != '' && format('{0}/', matrix.target) || ''}}release-speed/lang_cli${{ matrix.ext }} | |