Skip to content

Commit 7dc658b

Browse files
committed
ci: Restructure toolchain build process
This commit restructures the CI toolchain and distribution bundle build process in preparation for adding Clang/LLVM toolchain build process. The changes introduced in this commit are as follows: * Prefix all existing GNU toolchain build steps with `gnu`. * Relocate GNU toolchain directories to `gnu/` in the distribution bundle. * Rename "full distribution bundle" to "GNU distribution bundle" with `_gnu` suffix in the archive name. * Rename `sdk_toolchains` file, which contains the list of all available GNU toolchains to `sdk_gnu_toolchains`. * Relocate host tools root directory to `hosttools/` in the distribution bundle. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent f5dc324 commit 7dc658b

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ jobs:
419419
CONFIG_REPORT_CONTENT="${CONFIG_REPORT_CONTENT//$'\r'/'%0D'}"
420420
echo "::notice:: ${CONFIG_REPORT_CONTENT}"
421421
422-
# Build toolchain
423-
build-toolchain:
424-
name: Toolchain ${{ matrix.target }} (${{ matrix.host.name }})
422+
# Build GNU toolchain
423+
build-gnu-toolchain:
424+
name: GNU Toolchain ${{ matrix.target }} (${{ matrix.host.name }})
425425
needs: setup
426426
runs-on:
427427
group: ${{ matrix.host.runner }}
@@ -780,7 +780,7 @@ jobs:
780780
fi
781781
782782
# Create archive
783-
ARCHIVE_NAME=toolchain_${{ matrix.host.name }}_${{ matrix.target }}
783+
ARCHIVE_NAME=toolchain_gnu_${{ matrix.host.name }}_${{ matrix.target }}
784784
ARCHIVE_FILE=${ARCHIVE_NAME}.${{ matrix.host.archive }}
785785
786786
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
@@ -820,15 +820,15 @@ jobs:
820820
if: always()
821821
uses: actions/upload-artifact@v4
822822
with:
823-
name: log_${{ matrix.host.name }}_${{ matrix.target }}
823+
name: log_toolchain_gnu_${{ matrix.host.name }}_${{ matrix.target }}
824824
path: ${{ matrix.target }}.log
825825

826826
- name: Upload toolchain build artifact
827827
uses: actions/upload-artifact@v4
828828
with:
829-
name: toolchain_${{ matrix.host.name }}_${{ matrix.target }}
829+
name: toolchain_gnu_${{ matrix.host.name }}_${{ matrix.target }}
830830
path: |
831-
toolchain_${{ matrix.host.name }}_${{ matrix.target }}.${{ matrix.host.archive }}
831+
toolchain_gnu_${{ matrix.host.name }}_${{ matrix.target }}.${{ matrix.host.archive }}
832832
md5.sum
833833
sha256.sum
834834
@@ -1074,7 +1074,7 @@ jobs:
10741074
# Build distribution bundle
10751075
build-dist-bundle:
10761076
name: Distribution Bundle (${{ matrix.host.name }})
1077-
needs: [ setup, build-toolchain, build-hosttools, build-cmake-pkg ]
1077+
needs: [ setup, build-gnu-toolchain, build-hosttools, build-cmake-pkg ]
10781078
runs-on:
10791079
group: ${{ matrix.host.runner }}
10801080
container: ${{ matrix.host.container }}
@@ -1170,8 +1170,8 @@ jobs:
11701170
# Stage version file
11711171
echo "${VERSION}" > sdk_version
11721172
1173-
# Stage toolchain list file
1174-
echo '${{ needs.setup.outputs.targets }}' | jq -cr '.[]' > sdk_toolchains
1173+
# Stage GNU toolchain list file
1174+
echo '${{ needs.setup.outputs.targets }}' | jq -cr '.[]' > sdk_gnu_toolchains
11751175
11761176
# Stage CMake package
11771177
## Verify CMake package archive checksum
@@ -1192,8 +1192,13 @@ jobs:
11921192
sha256sum --check sha256.sum
11931193
popd
11941194
1195+
# Create host tools root directory
1196+
mkdir hosttools
1197+
11951198
# Extract host tools archive
1199+
pushd hosttools
11961200
${EXTRACT} ${ARTIFACT_ROOT}/${HOSTTOOLS_ARTIFACT}/${HOSTTOOLS_ARTIFACT}.${EXT}
1201+
popd
11971202
fi
11981203
11991204
# Stage setup script
@@ -1217,15 +1222,16 @@ jobs:
12171222
7z a -t7z -l ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
12181223
fi
12191224
1220-
# Stage toolchains
1221-
pushd ${ARCHIVE_DIR}
1225+
# Stage GNU toolchains
1226+
mkdir ${ARCHIVE_DIR}/gnu
1227+
pushd ${ARCHIVE_DIR}/gnu
12221228
12231229
## Generate target list from the workflow matrix
12241230
TARGETS=$(echo '${{ needs.setup.outputs.targets }}' | jq -cr '.[]')
12251231
12261232
## Extract all toolchains
12271233
for TARGET in ${TARGETS}; do
1228-
TOOLCHAIN_ARTIFACT=toolchain_${HOST}_${TARGET}
1234+
TOOLCHAIN_ARTIFACT=toolchain_gnu_${HOST}_${TARGET}
12291235
12301236
# Verify toolchain archive checksum
12311237
pushd ${ARTIFACT_ROOT}/${TOOLCHAIN_ARTIFACT}
@@ -1238,25 +1244,25 @@ jobs:
12381244
done
12391245
popd
12401246
1241-
# Create full distribution bundle archive
1247+
# Create GNU distribution bundle archive
12421248
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
12431249
XZ_OPT="-T0" \
1244-
${TAR} -Jcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
1250+
${TAR} -Jcvf ${ARCHIVE_NAME}_gnu.${EXT} --owner=0 --group=0 \
12451251
-C . ${ARCHIVE_DIR}
12461252
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1247-
7z a -t7z -l ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
1253+
7z a -t7z -l ${ARCHIVE_NAME}_gnu.${EXT} ${ARCHIVE_DIR}
12481254
fi
12491255
12501256
# Compute checksum
1251-
md5sum ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > md5.sum
1252-
sha256sum ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > sha256.sum
1257+
md5sum ${ARCHIVE_NAME}_gnu.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > md5.sum
1258+
sha256sum ${ARCHIVE_NAME}_gnu.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > sha256.sum
12531259
12541260
- name: Upload distribution bundle
12551261
uses: actions/upload-artifact@v4
12561262
with:
12571263
name: ${{ env.BUNDLE_ARCHIVE_NAME }}
12581264
path: |
1259-
${{ env.BUNDLE_ARCHIVE_NAME }}.${{ matrix.host.archive }}
1265+
${{ env.BUNDLE_ARCHIVE_NAME }}_gnu.${{ matrix.host.archive }}
12601266
${{ env.BUNDLE_ARCHIVE_NAME }}_minimal.${{ matrix.host.archive }}
12611267
md5.sum
12621268
sha256.sum
@@ -1405,8 +1411,8 @@ jobs:
14051411
sha256sum --check sha256.sum
14061412
popd
14071413
1408-
# Extract distribution bundle archive
1409-
BUNDLE_FILE=${BUNDLE_NAME}.${{ matrix.testenv.bundle-archive }}
1414+
# Extract GNU distribution bundle archive
1415+
BUNDLE_FILE=${BUNDLE_NAME}_gnu.${{ matrix.testenv.bundle-archive }}
14101416
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.xz" ]; then
14111417
${TAR} -Jxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
14121418
elif [ "${{ matrix.testenv.bundle-archive }}" == "7z" ]; then

0 commit comments

Comments
 (0)