Skip to content

Commit 993c669

Browse files
committed
fix: GitHub build script again
1 parent 3ebfb63 commit 993c669

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,25 @@ jobs:
1414
matrix:
1515
include:
1616
- platform: macos-latest # ARM
17-
args: "--target aarch64-apple-darwin"
17+
target: "aarch64-apple-darwin"
1818
name: macos
1919
arch: arm
20+
ext: ""
2021
- platform: macos-latest # Intel
21-
args: "--target x86_64-apple-darwin"
22+
target: "x86_64-apple-darwin"
2223
name: macos
2324
arch: x86_64
25+
ext: ""
2426
- platform: ubuntu-22.04
25-
args: ""
27+
target: ""
2628
name: linux
2729
arch: x86_64
30+
ext: ""
2831
- platform: windows-latest
29-
args: ""
32+
target: ""
3033
name: windows
3134
arch: x86_64
35+
ext: ".exe"
3236

3337
runs-on: ${{ matrix.platform }}
3438
steps:
@@ -47,17 +51,17 @@ jobs:
4751

4852
- name: Build - Size Opt.
4953
if: matrix.name != 'windows'
50-
run: ./scripts/build/size.sh "${{ matrix.args }}"
54+
run: ./scripts/build/size.sh "${{ matrix.target }}"
5155

5256
- name: Build - Size Opt.
5357
if: matrix.name == 'windows'
54-
run: ./scripts/build/size.ps1 ${{ matrix.args }}
58+
run: ./scripts/build/size.ps1
5559

5660
- name: Upload Build - Size Opt.
5761
uses: actions/upload-artifact@v4
5862
with:
5963
name: lang_cli-${{ matrix.name }}-${{ matrix.arch }}-size
60-
path: target/release-size/lang_cli
64+
path: target/release-size/lang_cli${{ matrix.ext }}
6165

6266

6367
# Speed Profile
@@ -66,15 +70,15 @@ jobs:
6670
if: matrix.name != 'windows'
6771
env:
6872
CPU_NATIVE: ${{ matrix.name }} != "macos" && ${{ matrix.arch }} != "x86_64"
69-
run: ./scripts/build/speed.sh "${{ matrix.args }}"
73+
run: ./scripts/build/speed.sh "${{ matrix.target }}"
7074

7175
- name: Build - Speed Opt.
7276
if: matrix.name == 'windows'
73-
run: ./scripts/build/speed.ps1 ${{ matrix.args }}
77+
run: ./scripts/build/speed.ps1
7478

7579
- name: Upload Build - Speed Opt.
7680
uses: actions/upload-artifact@v4
7781
with:
7882
name: lang_cli-${{ matrix.name }}-${{ matrix.arch }}
79-
path: target/release-speed/lang_cli
83+
path: target/${{ matrix.target != '' && format('{0}/', matrix.target) || ''}}release-speed/lang_cli${{ matrix.ext }}
8084

scripts/build/size.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env bash
22
RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none"
3+
TARGET=""
4+
5+
if [ -n $1 ]; then
6+
TARGET="--target $1"
7+
fi
8+
39
cargo +nightly build \
4-
$1 \
10+
$TARGET \
511
-Z build-std=std,panic_abort \
612
-Z build-std-features="optimize_for_size" \
713
-Z build-std-features=panic_immediate_abort \

scripts/build/speed.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22
RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none"
3+
TARGET=""
4+
5+
if [ -n $1 ]; then
6+
TARGET="--target $1"
7+
fi
38

49
if [ "$CPU_NATIVE" == "true" ]; then
510
RUSTFLAGS="$RUSTFLAGS -C target-cpu=native"

0 commit comments

Comments
 (0)