build: upload separate artifact for src files (#42486)

This commit is contained in:
Shelley Vohr 2024-06-13 16:35:13 -05:00 committed by GitHub
parent a0a8bd2222
commit 9fe1b05025
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 12 deletions

View file

@ -14,6 +14,7 @@ else
fi
GENERATED_ARTIFACTS="generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}"
SRC_ARTIFACTS="src_artifacts_${BUILD_TYPE}_${TARGET_ARCH}"
mv_if_exist() {
if [ -f "${GENERATED_ARTIFACTS}/$1" ] || [ -d "${GENERATED_ARTIFACTS}/$1" ]; then
@ -26,9 +27,9 @@ mv_if_exist() {
}
untar_if_exist() {
if [ -f "${GENERATED_ARTIFACTS}/$1" ] || [ -d "${GENERATED_ARTIFACTS}/$1" ]; then
if [ -f "${SRC_ARTIFACTS}/$1" ] || [ -d "${SRC_ARTIFACTS}/$1" ]; then
echo Restoring $1 to current directory
tar -xf ${GENERATED_ARTIFACTS}/$1
tar -xf ${SRC_ARTIFACTS}/$1
else
echo Skipping $1 - It is not present on disk
fi
@ -46,5 +47,7 @@ mv_if_exist ffmpeg.zip src/out/ffmpeg
mv_if_exist hunspell_dictionaries.zip src/out/Default
mv_if_exist cross-arch-snapshots src
# Restore build artifacts
untar_if_exist build_artifacts.tar
echo Restoring artifacts from $SRC_ARTIFACTS
# Restore src artifacts
untar_if_exist src_artifacts.tar