Skip to content

Commit 1926b37

Browse files
stephanosiokeith-packard
authored andcommitted
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. The `-l` option is used such that symbolic links are stored as copies of the linked files because Windows requires administrator privileges to create symbolic links. Note that 7z performs multi-threaded compression by default. For more details, refer to the issue #567. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 94e786f commit 1926b37

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
"name": "windows-x86_64",
253253
"runner": "zephyr_runner",
254254
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
255-
"archive": "zip"
255+
"archive": "7z"
256256
},'
257257
fi
258258
@@ -309,7 +309,7 @@ jobs:
309309
"runner": "windows-2019-8c",
310310
"container": "",
311311
"bundle-host": "windows-x86_64",
312-
"bundle-archive": "zip"
312+
"bundle-archive": "7z"
313313
},'
314314
fi
315315
@@ -413,7 +413,7 @@ jobs:
413413
sudo apt-get install -y autoconf automake bison flex gettext \
414414
help2man libboost-dev libboost-regex-dev \
415415
libncurses5-dev libtool-bin libtool-doc \
416-
pkg-config texinfo zip
416+
pkg-config texinfo p7zip
417417
418418
# Install dependencies for cross compilation
419419
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
@@ -758,10 +758,9 @@ jobs:
758758
XZ_OPT="-T0" \
759759
${TAR} -Jcvf ${ARCHIVE_FILE} \
760760
--owner=0 --group=0 -C ${OUTPUT_BASE}/${OUTPUT_DIR} ${{ matrix.target }}
761-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
761+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
762762
pushd ${OUTPUT_BASE}/${OUTPUT_DIR}
763-
zip -r ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} \
764-
${{ matrix.target }}
763+
7z a -t7z -l ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} ${{ matrix.target }}
765764
popd
766765
fi
767766
@@ -985,7 +984,7 @@ jobs:
985984
986985
# Install common dependencies
987986
sudo apt-get update
988-
sudo apt-get install -y zip
987+
sudo apt-get install -y p7zip
989988
990989
# Set environment variables
991990
echo "TAR=tar" >> $GITHUB_ENV
@@ -1030,9 +1029,8 @@ jobs:
10301029
XZ_OPT="-T0" \
10311030
${TAR} -Jcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
10321031
-C . cmake
1033-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1034-
zip -r ${ARCHIVE_FILE} \
1035-
cmake
1032+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1033+
7z a -t7z -l ${ARCHIVE_FILE} cmake
10361034
fi
10371035
10381036
# Compute checksum
@@ -1075,7 +1073,7 @@ jobs:
10751073
10761074
# Install common dependencies
10771075
sudo apt-get update
1078-
sudo apt-get install -y jq zip
1076+
sudo apt-get install -y jq p7zip
10791077
10801078
# Set environment variables
10811079
echo "TAR=tar" >> $GITHUB_ENV
@@ -1135,8 +1133,8 @@ jobs:
11351133
11361134
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
11371135
EXTRACT="${TAR} -Jxvf"
1138-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1139-
EXTRACT="unzip"
1136+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1137+
EXTRACT="7z x -o."
11401138
fi
11411139
11421140
# Create bundle directory
@@ -1189,8 +1187,8 @@ jobs:
11891187
XZ_OPT="-T0" \
11901188
${TAR} -Jcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
11911189
-C . ${ARCHIVE_DIR}
1192-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1193-
zip -r ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
1190+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1191+
7z a -t7z -l ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
11941192
fi
11951193
11961194
# Stage toolchains
@@ -1219,8 +1217,8 @@ jobs:
12191217
XZ_OPT="-T0" \
12201218
${TAR} -Jcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
12211219
-C . ${ARCHIVE_DIR}
1222-
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1223-
zip -r ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
1220+
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1221+
7z a -t7z -l ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
12241222
fi
12251223
12261224
# Compute checksum
@@ -1327,7 +1325,7 @@ jobs:
13271325
shopt -u dotglob
13281326
13291327
# Install required system packages
1330-
choco install ccache dtc-msys2 gperf jq ninja wget unzip
1328+
choco install ccache dtc-msys2 gperf jq ninja wget 7zip
13311329
13321330
# Upgrade pip
13331331
python3 -m pip install --upgrade pip
@@ -1384,8 +1382,8 @@ jobs:
13841382
BUNDLE_FILE=${BUNDLE_NAME}.${{ matrix.testenv.bundle-archive }}
13851383
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.xz" ]; then
13861384
${TAR} -Jxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
1387-
elif [ "${{ matrix.testenv.bundle-archive }}" == "zip" ]; then
1388-
unzip ${ARTIFACT_ROOT}/${BUNDLE_FILE} -d tools
1385+
elif [ "${{ matrix.testenv.bundle-archive }}" == "7z" ]; then
1386+
7z x -otools ${ARTIFACT_ROOT}/${BUNDLE_FILE}
13891387
fi
13901388
13911389
# Run setup script

scripts/template_setup_win

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ set /p VERSION=<sdk_version
3737

3838
REM # Resolve release download base URI
3939
set DL_REL_BASE=https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v%VERSION%
40-
set DL_TOOLCHAIN_FILENAME=toolchain_windows-x86_64_%%t.zip
40+
set DL_TOOLCHAIN_FILENAME=toolchain_windows-x86_64_%%t.7z
4141

4242
REM # Print banner
4343
echo Zephyr SDK %VERSION% Setup
@@ -54,7 +54,7 @@ call :check_command cmake 90
5454
if [%ERRORLEVEL%] neq [0] goto end
5555
call :check_command wget 91
5656
if [%ERRORLEVEL%] neq [0] goto end
57-
call :check_command unzip 92
57+
call :check_command 7z 92
5858
if [%ERRORLEVEL%] neq [0] goto end
5959

6060
REM # Enter interactive mode if enabled
@@ -152,7 +152,7 @@ for %%t in (%INST_TOOLCHAINS%) do (
152152
)
153153

154154
REM # Extract archive
155-
unzip -q !TOOLCHAIN_FILENAME!
155+
7z x -o. !TOOLCHAIN_FILENAME!
156156
if [!ERRORLEVEL!] neq [0] (
157157
echo ERROR: Toolchain archive extraction failed
158158
set EXITCODE=21

0 commit comments

Comments
 (0)