|
1 | | -name: "Install Rust Toolchain" |
2 | | -description: "Installs Rust toolchain with platform-specific targets" |
3 | | - |
4 | 1 | inputs: |
5 | 2 | platform: |
6 | | - description: "Target platform (macos, ios, android, windows, linux)" |
7 | 3 | required: false |
8 | 4 | default: "" |
9 | | - |
10 | 5 | runs: |
11 | 6 | using: "composite" |
12 | 7 | steps: |
13 | | - - run: rustup toolchain install 1.90.0 --profile minimal --no-self-update |
14 | | - shell: bash |
15 | 8 | - if: inputs.platform == 'macos' |
16 | | - run: rustup target add aarch64-apple-darwin x86_64-apple-darwin |
17 | | - shell: bash |
| 9 | + uses: moonrepo/setup-rust@v1 |
| 10 | + with: |
| 11 | + channel: "1.91.1" |
| 12 | + targets: aarch64-apple-darwin,x86_64-apple-darwin |
| 13 | + cache-target: release |
18 | 14 | - if: inputs.platform == 'ios' |
19 | | - run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim |
20 | | - shell: bash |
| 15 | + uses: moonrepo/setup-rust@v1 |
| 16 | + with: |
| 17 | + channel: "1.91.1" |
| 18 | + targets: aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim |
| 19 | + cache-target: release |
21 | 20 | - if: inputs.platform == 'android' |
22 | | - run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android |
23 | | - shell: bash |
| 21 | + uses: moonrepo/setup-rust@v1 |
| 22 | + with: |
| 23 | + channel: "1.91.1" |
| 24 | + targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android |
| 25 | + cache-target: release |
24 | 26 | - if: inputs.platform == 'windows' |
25 | | - run: | |
26 | | - rustup target add x86_64-pc-windows-msvc |
27 | | - # https://tauri.app/distribute/sign/windows/#install-trusted-signing-cli |
28 | | - cargo install trusted-signing-cli |
29 | | - shell: bash |
| 27 | + uses: moonrepo/setup-rust@v1 |
| 28 | + with: |
| 29 | + channel: "1.91.1" |
| 30 | + targets: x86_64-pc-windows-msvc |
| 31 | + bins: trusted-signing-cli |
| 32 | + cache-target: release |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ github.token }} |
| 35 | + - if: inputs.platform == 'linux' |
| 36 | + uses: moonrepo/setup-rust@v1 |
| 37 | + with: |
| 38 | + channel: "1.91.1" |
| 39 | + targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu |
| 40 | + cache-target: release |
30 | 41 | - if: inputs.platform == 'linux' |
31 | 42 | run: | |
32 | | - rustup target add x86_64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-gnu |
33 | 43 | sudo apt-get update |
34 | 44 | sudo apt-get install -y gcc-aarch64-linux-gnu libasound2-dev |
35 | 45 | shell: bash |
36 | | - - uses: Swatinem/rust-cache@v2 |
| 46 | + - if: inputs.platform == '' |
| 47 | + uses: moonrepo/setup-rust@v1 |
37 | 48 | with: |
38 | | - workspaces: | |
39 | | - . -> target |
40 | | - apps/desktop/src-tauri -> target |
| 49 | + channel: "1.91.1" |
| 50 | + cache-target: release |
0 commit comments