|
11 | 11 |
|
12 | 12 | jobs: |
13 | 13 | build: |
14 | | - runs-on: ${{ matrix.os }} |
| 14 | + name: Build (${{ matrix.platform.os-name }}) |
| 15 | + runs-on: ${{ matrix.platform.runs-on }} |
15 | 16 | strategy: |
16 | 17 | matrix: |
17 | | - os: [macos-latest, ubuntu-22.04, windows-latest] |
| 18 | + platform: |
| 19 | + - os-name: Linux-x86_64 |
| 20 | + runs-on: ubuntu-24.04 |
| 21 | + target: x86_64-unknown-linux-gnu |
| 22 | + command: both |
| 23 | + |
| 24 | + - os-name: Linux-arm64 |
| 25 | + runs-on: ubuntu-24.04-arm |
| 26 | + target: aarch64-unknown-linux-gnu |
| 27 | + command: both |
| 28 | + |
| 29 | + - os-name: Windows-x86_64 |
| 30 | + runs-on: windows-latest |
| 31 | + target: x86_64-pc-windows-msvc |
| 32 | + command: both |
| 33 | + |
| 34 | + - os-name: Windows-arm64 |
| 35 | + runs-on: windows-latest |
| 36 | + target: aarch64-pc-windows-msvc |
| 37 | + command: build |
| 38 | + |
| 39 | + - os-name: macOS-x86_64 |
| 40 | + runs-on: macos-latest |
| 41 | + target: x86_64-apple-darwin |
| 42 | + command: both |
| 43 | + |
| 44 | + - os-name: macOS-arm64 |
| 45 | + runs-on: macos-latest |
| 46 | + target: aarch64-apple-darwin |
| 47 | + command: both |
| 48 | + |
18 | 49 | steps: |
19 | 50 | - uses: actions/checkout@v4 |
20 | 51 |
|
21 | | - - name: Run tests |
22 | | - run: cargo test |
23 | | - |
24 | 52 | - name: Build |
25 | | - run: cargo build --all --release |
| 53 | + uses: houseabsolute/actions-rust-cross@v1 |
| 54 | + with: |
| 55 | + command: ${{ matrix.platform.command }} |
| 56 | + target: ${{ matrix.platform.target }} |
| 57 | + args: "--locked --all --release" |
26 | 58 |
|
27 | 59 | - name: Store command line tool |
28 | 60 | uses: actions/upload-artifact@v4 |
29 | 61 | with: |
30 | | - name: rdfu-${{ matrix.os }} |
| 62 | + name: rdfu-${{ matrix.platform.os-name }} |
31 | 63 | path: | |
32 | | - target/release/rdfu* |
33 | | - !target/release/rdfu.d |
34 | | - !target/release/rdfu.pdb |
| 64 | + target/${{ matrix.platform.target }}/release/rdfu* |
| 65 | + !target/${{ matrix.platform.target }}/release/rdfu.d |
| 66 | + !target/${{ matrix.platform.target }}/release/rdfu.pdb |
35 | 67 |
|
36 | 68 | - name: Package library |
37 | 69 | shell: bash |
38 | | - run: ./package.sh |
| 70 | + env: |
| 71 | + TARGET: ${{ matrix.platform.target }} |
| 72 | + run: ./package.sh $TARGET "target/$TARGET" "release" |
39 | 73 |
|
40 | 74 | - name: Store library |
41 | 75 | uses: actions/upload-artifact@v4 |
42 | 76 | with: |
43 | | - name: library-${{ matrix.os }} |
| 77 | + name: library-${{ matrix.platform.os-name }} |
44 | 78 | path: rs_dfu-*.tar.gz |
45 | 79 |
|
46 | 80 | release: |
|
0 commit comments