Skip to content

Commit 311ce7c

Browse files
committed
ci: Use 7z format for Windows build artifacts
This commit updates the CI workflow to output .7z archives for the Windows build artifacts. The 7z format uses the LZMA compression algorithm, which offers significantly improved data compression ratio. Note that 7z performs multi-threaded compression by default. For more details, refer to the issue zephyrproject-rtos/sdk-ng#567. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent fda08a9 commit 311ce7c

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ jobs:
248248
"name": "windows-x86_64",
249249
"runner": "zephyr_runner",
250250
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
251-
"archive": "zip"
251+
"archive": "7z"
252252
},'
253253
fi
254254
@@ -305,7 +305,7 @@ jobs:
305305
"runner": "windows-2019-8c",
306306
"container": "",
307307
"bundle-host": "windows-x86_64",
308-
"bundle-archive": "zip"
308+
"bundle-archive": "7z"
309309
},'
310310
fi
311311
@@ -409,7 +409,7 @@ jobs:
409409
sudo apt-get install -y autoconf automake bison flex gettext \
410410
help2man libboost-dev libboost-regex-dev \
411411
libncurses5-dev libtool-bin libtool-doc \
412-
pkg-config texinfo zip
412+
pkg-config texinfo p7zip
413413
414414
# Install dependencies for cross compilation
415415
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
@@ -754,10 +754,9 @@ jobs:
754754
XZ_OPT="-T0" \
755755
${TAR} -Jcvf ${ARCHIVE_FILE} \
756756
--owner=0 --group=0 -C ${OUTPUT_BASE}/${OUTPUT_DIR} ${{ matrix.target }}
757-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
757+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
758758
pushd ${OUTPUT_BASE}/${OUTPUT_DIR}
759-
zip -r ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} \
760-
${{ matrix.target }}
759+
7z a -t7z ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} ${{ matrix.target }}
761760
popd
762761
fi
763762
@@ -981,7 +980,7 @@ jobs:
981980
982981
# Install common dependencies
983982
sudo apt-get update
984-
sudo apt-get install -y zip
983+
sudo apt-get install -y p7zip
985984
986985
# Set environment variables
987986
echo "TAR=tar" >> $GITHUB_ENV
@@ -1026,9 +1025,8 @@ jobs:
10261025
XZ_OPT="-T0" \
10271026
${TAR} -Jcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
10281027
-C . cmake
1029-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1030-
zip -r ${ARCHIVE_FILE} \
1031-
cmake
1028+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1029+
7z a -t7z ${ARCHIVE_FILE} cmake
10321030
fi
10331031
10341032
# Compute checksum
@@ -1071,7 +1069,7 @@ jobs:
10711069
10721070
# Install common dependencies
10731071
sudo apt-get update
1074-
sudo apt-get install -y jq zip
1072+
sudo apt-get install -y jq p7zip
10751073
10761074
# Set environment variables
10771075
echo "TAR=tar" >> $GITHUB_ENV
@@ -1131,8 +1129,8 @@ jobs:
11311129
11321130
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
11331131
EXTRACT="${TAR} -Jxvf"
1134-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1135-
EXTRACT="unzip"
1132+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1133+
EXTRACT="7z x -o."
11361134
fi
11371135
11381136
# Create bundle directory
@@ -1185,8 +1183,8 @@ jobs:
11851183
XZ_OPT="-T0" \
11861184
${TAR} -Jcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
11871185
-C . ${ARCHIVE_DIR}
1188-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1189-
zip -r ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
1186+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1187+
7z a -t7z ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
11901188
fi
11911189
11921190
# Stage toolchains
@@ -1215,8 +1213,8 @@ jobs:
12151213
XZ_OPT="-T0" \
12161214
${TAR} -Jcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
12171215
-C . ${ARCHIVE_DIR}
1218-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1219-
zip -r ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
1216+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1217+
7z a -t7z ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
12201218
fi
12211219
12221220
# Compute checksum
@@ -1323,7 +1321,7 @@ jobs:
13231321
shopt -u dotglob
13241322
13251323
# Install required system packages
1326-
choco install ccache dtc-msys2 gperf jq ninja wget unzip
1324+
choco install ccache dtc-msys2 gperf jq ninja wget 7zip
13271325
13281326
# Upgrade pip
13291327
python3 -m pip install --upgrade pip
@@ -1380,8 +1378,8 @@ jobs:
13801378
BUNDLE_FILE=${BUNDLE_NAME}.${{ matrix.testenv.bundle-archive }}
13811379
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.xz" ]; then
13821380
${TAR} -Jxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
1383-
elif [ "${{ matrix.testenv.bundle-archive }}" == "zip" ]; then
1384-
unzip ${ARTIFACT_ROOT}/${BUNDLE_FILE} -d tools
1381+
elif [ "${{ matrix.testenv.bundle-archive }}" == "7z" ]; then
1382+
7z x -otools ${ARTIFACT_ROOT}/${BUNDLE_FILE}
13851383
fi
13861384
13871385
# Run setup script

0 commit comments

Comments
 (0)