|
9 | 9 | runs-on: ${{ matrix.os }} |
10 | 10 | strategy: |
11 | 11 | matrix: |
12 | | - os: [ubuntu-latest, windows-latest, macos-latest] |
| 12 | + build_name: |
| 13 | + [linux-x64-musl, linux-arm64-musl, macos-arm64, windows-x64-msvc] |
13 | 14 | include: |
14 | | - - os: ubuntu-latest |
| 15 | + - build_name: linux-x64-musl |
| 16 | + os: ubuntu-latest |
15 | 17 | exe_suffix: "" |
16 | 18 | name_suffix: "" |
17 | 19 | target: x86_64-unknown-linux-musl |
18 | | - - os: macos-latest |
| 20 | + - build_name: linux-arm64-musl |
| 21 | + os: ubuntu-latest |
| 22 | + exe_suffix: "" |
| 23 | + name_suffix: "" |
| 24 | + target: aarch64-unknown-linux-musl |
| 25 | + - build_name: macos-arm64 |
| 26 | + os: macos-latest |
19 | 27 | exe_suffix: "" |
20 | 28 | name_suffix: ".arm" |
21 | 29 | target: aarch64-apple-darwin |
22 | | - - os: windows-latest |
| 30 | + - build_name: windows-x64-msvc |
| 31 | + os: windows-latest |
23 | 32 | exe_suffix: ".exe" |
24 | 33 | name_suffix: ".exe" |
25 | 34 | target: x86_64-pc-windows-msvc |
26 | 35 | steps: |
27 | 36 | - uses: actions/checkout@v3 |
28 | | - - name: Update rust |
| 37 | + - name: Update Rust |
29 | 38 | run: rustup update |
30 | 39 | - name: Add target |
31 | 40 | run: rustup target add ${{ matrix.target }} |
32 | 41 | - name: Cache dependencies |
33 | 42 | uses: Swatinem/rust-cache@v2 |
34 | 43 | - name: Build |
35 | | - run: "cargo build --release --locked --verbose --target ${{ matrix.target }}" |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + _cargo="cargo" |
| 47 | + if [ "${{ matrix.build_name }}" = "linux-arm64-musl" ]; then |
| 48 | + cargo install cross |
| 49 | + _cargo="cross" |
| 50 | + fi |
| 51 | + $_cargo build --release --locked --verbose --target ${{ matrix.target }} |
36 | 52 | - name: Upload asset |
37 | 53 | uses: actions/upload-release-asset@v1.0.2 |
38 | 54 | env: |
39 | 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
40 | 56 | with: |
41 | 57 | asset_path: target/${{ matrix.target }}/release/dotter${{ matrix.exe_suffix }} |
42 | | - asset_name: dotter${{ matrix.name_suffix }} |
| 58 | + asset_name: dotter-${{ matrix.build_name}}${{ matrix.name_suffix }} |
43 | 59 | asset_content_type: application/octet-stream |
44 | 60 | upload_url: ${{ github.event.release.upload_url }} |
45 | 61 | build-completions: |
|
0 commit comments