File tree Expand file tree Collapse file tree 3 files changed +40
-11
lines changed
Expand file tree Collapse file tree 3 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Build Pi software
2+
3+ on :
4+ push : {}
5+ pull_request : {}
6+ workflow_dispatch : {}
7+
8+ jobs :
9+ build :
10+ name : Build
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Check out sources
14+ uses : actions/checkout@v6
15+ with :
16+ sparse-checkout : |
17+ Software
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+
22+ - name : Build binary
23+ run : ./build-rpi.sh
24+ working-directory : Software
25+
26+ - name : Upload binary
27+ uses : actions/upload-artifact@v6
28+ with :
29+ name : phone-bell-software-arm64
30+ path : Software/phone-bell-software-arm64
31+ if-no-files-found : error
32+ compression-level : 0
Original file line number Diff line number Diff line change @@ -31,5 +31,12 @@ COPY . .
3131
3232# Build for Raspberry Pi (no-default-features to skip druid/GUI)
3333RUN cargo build --release --target aarch64-unknown-linux-gnu --no-default-features --features real
34+ RUN aarch64-linux-gnu-strip /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software
3435
3536# The binary will be at /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software
37+
38+ FROM scratch
39+ COPY --from=builder /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software /phone-bell-software-arm64
40+ ENTRYPOINT ["/phone-bell-software-arm64" ]
41+
42+ # The binary will be at /phone-bell-software-arm64 in the output image
Original file line number Diff line number Diff line change 44cd " $( dirname " $0 " ) "
55
66echo " Building Docker image..."
7- docker build -t phone-bell-builder .
8-
9- echo " Extracting binary..."
10- docker create --name phone-bell-temp phone-bell-builder
11- docker cp phone-bell-temp:/app/target/aarch64-unknown-linux-gnu/release/phone-bell-software ./phone-bell-software-arm64
12- docker rm phone-bell-temp
13-
14- echo " Stripping debug symbols..."
15- docker run --rm -v " $( pwd) :/out" phone-bell-builder \
16- aarch64-linux-gnu-strip -o /out/phone-bell-software-arm64 /out/phone-bell-software-arm64
17-
7+ docker build -o . .
188echo " Done! Binary: phone-bell-software-arm64"
199ls -lh phone-bell-software-arm64
You can’t perform that action at this time.
0 commit comments