-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.75 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build
on:
push:
branches: [ "main" ]
tags: ["v*.*.*"]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build - ${{ matrix.platform.arch }}
strategy:
matrix:
platform:
- arch: x86_64
target: x86_64-unknown-linux-musl
runs-on: ubuntu-latest
- arch: aarch64
target: aarch64-unknown-linux-musl
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build base image
env:
ARCH: ${{ matrix.platform.arch }}
run: |
if [ "$ARCH" != "$(uname -m)" ]; then
sudo apt-get update
sudo apt-get install qemu-user-static
fi
cargo run --bin build-img -- -a $ARCH
cargo clean
- name: Upload artifacts - base image
uses: actions/upload-artifact@v4
with:
name: base-${{ matrix.platform.target }}
path: |
base.tar.xz
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release --features embedded_image"
strip: true
- name: Rename binary
env:
TARGET: ${{ matrix.platform.target }}
run: |
mv "target/$TARGET/release/dive" "dive-$TARGET"
- name: Upload artifacts - binary
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.platform.target }}
path: dive-*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: dive-*