@@ -15,74 +15,109 @@ env:
1515 RUSTUP_MAX_RETRIES : 10
1616
1717jobs :
18- build :
19- name : Build ${{ matrix.target }}
20- runs-on : ${{ matrix.os }}
21- strategy :
22- fail-fast : false
23- matrix :
24- include :
25- - os : macos-latest
26- target : aarch64-apple-darwin
27- - os : ubuntu-latest
28- target : aarch64-unknown-linux-gnu
29- - os : ubuntu-latest
30- target : x86_64-unknown-linux-gnu
31-
18+ build-macos :
19+ name : Build aarch64-apple-darwin
20+ runs-on : namespace-profile-gitar-macos
3221 steps :
3322 - name : Checkout repository
34- uses : actions/ checkout@v4
23+ uses : namespacelabs/nscloud- checkout-action@v5
3524 with :
3625 ref : ${{ inputs.tag }}
3726
3827 - name : Install Rust toolchain
3928 uses : dtolnay/rust-toolchain@stable
29+
30+ - name : Cache Dependencies
31+ uses : Swatinem/rust-cache@v2
32+
33+ - name : Build
34+ run : cargo build --release --package prisma-cli --features postgresql,mocking
35+
36+ - name : Create zip
37+ run : |
38+ cd target/release
39+ zip prisma-cli-aarch64-apple-darwin.zip prisma
40+
41+ - name : Upload artifact
42+ uses : actions/upload-artifact@v4
4043 with :
41- targets : ${{ matrix.target }}
44+ name : prisma-cli-aarch64-apple-darwin
45+ path : target/release/prisma-cli-aarch64-apple-darwin.zip
4246
43- - name : Install OpenSSL (Ubuntu x86_64)
44- if : matrix.target == 'x86_64-unknown-linux-gnu'
45- run : sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
47+ build-linux-x86 :
48+ name : Build x86_64-unknown-linux-gnu
49+ runs-on : namespace-profile-gitar
50+ steps :
51+ - name : Checkout repository
52+ uses : namespacelabs/nscloud-checkout-action@v5
53+ with :
54+ ref : ${{ inputs.tag }}
4655
47- - name : Install cross (Linux aarch64)
48- if : matrix.target == 'aarch64-unknown-linux-gnu'
49- run : cargo install cross --git https://github.com/cross-rs/cross
56+ - name : Install Rust toolchain
57+ uses : dtolnay/rust-toolchain@stable
5058
5159 - name : Cache Dependencies
5260 uses : Swatinem/rust-cache@v2
53- with :
54- key : ${{ matrix.target }}
5561
56- - name : Build (native)
57- if : matrix.target != 'aarch64-unknown-linux-gnu'
62+ - name : Build
5863 run : cargo build --release --package prisma-cli --features postgresql,mocking
5964
60- - name : Build (cross-compile Linux aarch64)
61- if : matrix.target == 'aarch64-unknown-linux-gnu'
62- run : cross build --release --package prisma-cli --features postgresql,mocking --target ${{ matrix.target }}
63-
64- - name : Create zip (macOS/Linux native)
65- if : matrix.target != 'aarch64-unknown-linux-gnu'
65+ - name : Create zip
6666 run : |
6767 cd target/release
68- zip prisma-cli-${{ matrix.target }}.zip prisma
68+ zip prisma-cli-x86_64-unknown-linux-gnu.zip prisma
69+
70+ - name : Upload artifact
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : prisma-cli-x86_64-unknown-linux-gnu
74+ path : target/release/prisma-cli-x86_64-unknown-linux-gnu.zip
75+
76+ build-linux-arm :
77+ name : Build aarch64-unknown-linux-gnu
78+ runs-on : namespace-profile-gitar
79+ steps :
80+ - name : Checkout repository
81+ uses : namespacelabs/nscloud-checkout-action@v5
82+ with :
83+ ref : ${{ inputs.tag }}
84+
85+ - name : Install Rust toolchain
86+ uses : dtolnay/rust-toolchain@stable
87+ with :
88+ targets : aarch64-unknown-linux-gnu
89+
90+ - name : Install Zig
91+ uses : goto-bus-stop/setup-zig@v2
92+ with :
93+ version : 0.13.0
94+
95+ - name : Install cargo-zigbuild
96+ run : cargo install cargo-zigbuild
97+
98+ - name : Cache Dependencies
99+ uses : Swatinem/rust-cache@v2
100+ with :
101+ key : aarch64-unknown-linux-gnu
102+
103+ - name : Build with zigbuild
104+ run : cargo zigbuild --release --package prisma-cli --features postgresql,mocking --target aarch64-unknown-linux-gnu
69105
70- - name : Create zip (Linux cross-compiled)
71- if : matrix.target == 'aarch64-unknown-linux-gnu'
106+ - name : Create zip
72107 run : |
73- cd target/${{ matrix.target }} /release
74- zip prisma-cli-${{ matrix.target }} .zip prisma
108+ cd target/aarch64-unknown-linux-gnu /release
109+ zip prisma-cli-aarch64-unknown-linux-gnu .zip prisma
75110
76111 - name : Upload artifact
77112 uses : actions/upload-artifact@v4
78113 with :
79- name : prisma-cli-${{ matrix.target }}
80- path : target/** /release/prisma-cli-${{ matrix.target }} .zip
114+ name : prisma-cli-aarch64-unknown-linux-gnu
115+ path : target/aarch64-unknown-linux-gnu /release/prisma-cli-aarch64-unknown-linux-gnu .zip
81116
82117 upload-release :
83118 name : Upload to Release
84- needs : build
85- runs-on : ubuntu-latest
119+ needs : [ build-macos, build-linux-x86, build-linux-arm]
120+ runs-on : namespace-profile-gitar-small
86121 permissions :
87122 contents : write
88123
0 commit comments