From 6fa24af2d8af2f0cd554acc0fcc8650143898930 Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Thu, 8 Aug 2024 01:06:08 +0800 Subject: [PATCH] updated github actions workflow --- .github/workflows/build-validation.yml | 2 +- build2.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 build2.sh diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml index 23d73a6..a06ff1f 100644 --- a/.github/workflows/build-validation.yml +++ b/.github/workflows/build-validation.yml @@ -37,7 +37,7 @@ jobs: apt update && apt install -y curl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y echo $HOME - . "$HOME/.cargo/env" + . "/github/home/.cargo/env" - name: Testing run: | diff --git a/build2.sh b/build2.sh new file mode 100644 index 0000000..a85634c --- /dev/null +++ b/build2.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +IMAGE_NAME="ubuntu:22.04" +HOST_PROJECT_DIR="$PWD" +CONTAINER_PROJECT_DIR="/app" +HOST_OUTPUT_DIR="$PWD/src-tauri/target/release/bundle/appimage" +CONTAINER_OUTPUT_DIR="$CONTAINER_PROJECT_DIR/src-tauri/target/release/bundle/appimage" +USER_ID=$(id -u) +GROUP_ID=$(id -g) + +docker pull $IMAGE_NAME + +# run the docker image and remove on completion +docker run --rm -it \ + -v "$HOST_PROJECT_DIR":$CONTAINER_PROJECT_DIR \ + $IMAGE_NAME \ + /bin/bash -c " + + # update packages + apt update && apt install curl -y && \ + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ + echo $HOME && \ + source "/root/.cargo/env" && \ + cargo --version + "