-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (67 loc) · 2.2 KB
/
build.yml
File metadata and controls
84 lines (67 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 }}