-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
21 deletions.
There are no files selected for viewing
15 changes: 6 additions & 9 deletions
15
.github/workflows/build/Dockerfile → .github/files/build/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
# syntax=docker/dockerfile:1.6.0@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021 | ||
FROM --platform=$BUILDPLATFORM busybox:latest@sha256:5c63a9b46e7139d2d5841462859edcbbf57f238af891b6096578e5894cfe5ae2 AS env | ||
ARG TARGETPLATFORM | ||
ARG BINARY_NAME=rust-ci-test | ||
RUN --mount=type=bind,source=artifact,target=artifact \ | ||
if [ "$TARGETPLATFORM" = 'darwin/amd64' ]; then\ | ||
cp artifact/x86_64-apple-darwin/"$BINARY_NAME" .\ | ||
cp artifact/x86_64-apple-darwin/binary .\ | ||
;elif [ "$TARGETPLATFORM" = 'darwin/arm64' ]; then\ | ||
cp artifact/aarch64-apple-darwin/"$BINARY_NAME" .\ | ||
cp artifact/aarch64-apple-darwin/binary .\ | ||
;elif [ "$TARGETPLATFORM" = 'linux/amd64' ]; then\ | ||
cp artifact/x86_64-unknown-linux-musl/"$BINARY_NAME" .\ | ||
cp artifact/x86_64-unknown-linux-musl/binary .\ | ||
;elif [ "$TARGETPLATFORM" = 'linux/arm64' ]; then\ | ||
cp artifact/aarch64-unknown-linux-musl/"$BINARY_NAME" .\ | ||
;elif [ "$TARGETPLATFORM" = 'windows/amd64' ]; then\ | ||
cp artifact/x86_64-pc-windows-msvc/"$BINARY_NAME".exe "$BINARY_NAME"\ | ||
cp artifact/aarch64-unknown-linux-musl/binary .\ | ||
;fi | ||
|
||
FROM scratch | ||
COPY --from=env --chmod=755 rust-ci-test . | ||
ENTRYPOINT ["./rust-ci-test"] | ||
COPY --from=env --chmod=755 binary . | ||
ENTRYPOINT ["./binary"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters