Skip to content

Commit 9635345

Browse files
authored
[rust] Build static Rust binaries for Selenium Manager (#11400) (#11471)
1 parent e0a472b commit 9635345

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/workflows/build-selenium-manager.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,46 @@ jobs:
66
windows:
77
name: "[Windows] Build selenium-manager"
88
runs-on: windows-latest
9+
env:
10+
RUSTFLAGS: '-C target-feature=+crt-static'
911
steps:
1012
- name: "Checkout project"
1113
uses: actions/checkout@v3
12-
- name: "Build release"
14+
- name: "Update Rust"
1315
run: |
1416
rustup update
17+
rustc -vV
18+
- name: "Build release"
19+
run: |
1520
cd rust
16-
cargo build --release
21+
cargo build --release --target x86_64-pc-windows-msvc
1722
- name: "Upload binary"
1823
uses: actions/upload-artifact@v3
1924
with:
2025
name: selenium-manager_windows-x64
21-
path: rust/target/release/selenium-manager.exe
26+
path: rust/target/x86_64-pc-windows-msvc/release/selenium-manager.exe
2227
retention-days: 6
2328

2429
linux:
2530
name: "[Linux] Build selenium-manager"
2631
runs-on: ubuntu-latest
32+
env:
33+
RUSTFLAGS: '-C target-feature=+crt-static'
2734
steps:
2835
- name: "Checkout project"
2936
uses: actions/checkout@v3
30-
- name: "Build release"
37+
- name: "Update Rust"
3138
run: |
3239
rustup update
40+
rustc -vV
41+
- name: "Build release"
42+
run: |
3343
cd rust
34-
cargo build --release
44+
cargo build --release --target x86_64-unknown-linux-gnu
3545
- name: "Tar binary (to keep executable permission)"
3646
run: |
37-
cd rust/target/release
38-
tar -cvf ../../../selenium-manager.tar selenium-manager
47+
cd rust/target/x86_64-unknown-linux-gnu/release
48+
tar -cvf ../../../../selenium-manager.tar selenium-manager
3949
- name: "Upload binary"
4050
uses: actions/upload-artifact@v3
4151
with:
@@ -46,18 +56,23 @@ jobs:
4656
macos:
4757
name: "[macOS] Build selenium-manager"
4858
runs-on: macos-latest
59+
env:
60+
RUSTFLAGS: '-C target-feature=+crt-static'
4961
steps:
5062
- name: "Checkout project"
5163
uses: actions/checkout@v3
52-
- name: "Build release"
64+
- name: "Update Rust"
5365
run: |
5466
rustup update
67+
rustc -vV
68+
- name: "Build release"
69+
run: |
5570
cd rust
56-
cargo build --release
71+
cargo build --release --target x86_64-apple-darwin
5772
- name: "Tar binary (to keep executable permission)"
5873
run: |
59-
cd rust/target/release
60-
tar -cvf ../../../selenium-manager.tar selenium-manager
74+
cd rust/target/x86_64-apple-darwin/release
75+
tar -cvf ../../../../selenium-manager.tar selenium-manager
6176
- name: "Upload binary"
6277
uses: actions/upload-artifact@v3
6378
with:

0 commit comments

Comments
 (0)