Skip to content

Commit

Permalink
perf: loong64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed Aug 10, 2024
1 parent 93f7496 commit b2b03e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ jobs:
export DOCKER_GID=$(id -g)
cat /etc/passwd
env
docker compose up
tools/build-deepin-loongarch.sh
if [ -f tmp/exit_code ];then
exit $(cat tmp/exit_code)
fi
Expand Down
16 changes: 0 additions & 16 deletions docker-compose.yml

This file was deleted.

26 changes: 25 additions & 1 deletion tools/build-deepin-loongarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,34 @@ notice() {
fail() {
echo -e "\033[41;37m 失败 \033[0m $1"
}

DOCKER_UID=$(id -u)
DOCKER_GID=$(id -g)
BUILD_TAG=${BUILD_TAG:-1.0.0}
BUILD_ARCH=${BUILD_ARCH:-loong64}

# why use docker to build? a) old system does support loong64.
docker run \
--rm -i \
-e "DOCKER_GID=${DOCKER_GID}" \
-e "DOCKER_UID=${DOCKER_UID}" \
-e "BUILD_TAG=${BUILD_TAG}" \
-e "BUILD_ARCH=${BUILD_ARCH}" \
-w /workspace \
-v "$root_dir:/workspace" \
ubuntu:24.04 \
sh <<\EOF
apt update
apt install -y devscripts build-essential debhelper
echo $DOCKER_GID
echo $DOCKER_UID
echo $BUILD_TAG
echo $BUILD_ARCH
groupadd -g $DOCKER_GID docker
useradd -m -u $DOCKER_UID -g $DOCKER_GID builder && passwd -d builder
cat /etc/passwd
su - builder -c "BUILD_ARCH=$BUILD_ARCH $root_dir/tools/build-deepin.sh $BUILD_TAG"
user=$(getent passwd $DOCKER_UID | cut -d: -f1)
su - $user -c "BUILD_ARCH=$BUILD_ARCH /workspace/tools/build-deepin.sh $BUILD_TAG"
EOF

0 comments on commit b2b03e4

Please sign in to comment.