build: add Linux GHA build step (#42432)
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
parent
83748bd181
commit
ffe1d70f1d
4 changed files with 322 additions and 34 deletions
|
@ -1,11 +1,13 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
if [ -z "$MAS_BUILD" ]; then
|
||||
BUILD_TYPE="darwin"
|
||||
else
|
||||
BUILD_TYPE="mas"
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
if [ -z "$MAS_BUILD" ]; then
|
||||
BUILD_TYPE="darwin"
|
||||
else
|
||||
BUILD_TYPE="mas"
|
||||
fi
|
||||
elif [ "`uname`" == "Linux" ]; then
|
||||
BUILD_TYPE="linux"
|
||||
fi
|
||||
|
||||
echo Creating generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}...
|
||||
|
@ -20,6 +22,7 @@ mv_if_exist() {
|
|||
echo Skipping $1 - It is not present on disk
|
||||
fi
|
||||
}
|
||||
|
||||
cp_if_exist() {
|
||||
if [ -f "$1" ] || [ -d "$1" ]; then
|
||||
echo Storing $1
|
||||
|
@ -29,6 +32,40 @@ cp_if_exist() {
|
|||
fi
|
||||
}
|
||||
|
||||
tar_src_dirs_if_exist() {
|
||||
mkdir build_artifacts
|
||||
|
||||
for dir in \
|
||||
src/out/Default/gen/node_headers \
|
||||
src/out/Default/overlapped-checker \
|
||||
src/out/Default/ffmpeg \
|
||||
src/out/Default/hunspell_dictionaries \
|
||||
src/electron \
|
||||
src/third_party/electron_node \
|
||||
src/third_party/nan \
|
||||
src/cross-arch-snapshots \
|
||||
src/third_party/llvm-build \
|
||||
src/build/linux \
|
||||
src/buildtools/mac \
|
||||
src/buildtools/third_party/libc++ \
|
||||
src/buildtools/third_party/libc++abi \
|
||||
src/third_party/libc++ \
|
||||
src/third_party/libc++abi \
|
||||
src/out/Default/obj/buildtools/third_party \
|
||||
src/v8/tools/builtins-pgo
|
||||
do
|
||||
if [ -d "$dir" ]; then
|
||||
mkdir -p build_artifacts/$dir
|
||||
cp -r $dir build_artifacts/$dir
|
||||
fi
|
||||
done
|
||||
|
||||
tar -cf build_artifacts.tarbuild_artifacts
|
||||
|
||||
mv_if_exist build_artifacts.tar
|
||||
}
|
||||
|
||||
# Generated Artifacts
|
||||
mv_if_exist src/out/Default/dist.zip
|
||||
mv_if_exist src/out/Default/gen/node_headers.tar.gz
|
||||
mv_if_exist src/out/Default/symbols.zip
|
||||
|
@ -39,3 +76,6 @@ mv_if_exist src/out/Default/hunspell_dictionaries.zip
|
|||
mv_if_exist src/cross-arch-snapshots
|
||||
cp_if_exist src/out/electron_ninja_log
|
||||
cp_if_exist src/out/Default/.ninja_log
|
||||
|
||||
tar_src_dirs_if_exist
|
||||
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
mv_if_exist() {
|
||||
if [ -f "generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1" ] || [ -d "generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1" ]; then
|
||||
echo Restoring $1 to $2
|
||||
mkdir -p $2
|
||||
mv generated_artifacts_${BUILD_TYPE_${TARGET_ARCH}}/$1 $2
|
||||
mv generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1 $2
|
||||
else
|
||||
echo Skipping $1 - It is not present on disk
|
||||
fi
|
||||
}
|
||||
|
||||
untar_if_exist() {
|
||||
if [ -f "generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1" ] || [ -d "generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1" ]; then
|
||||
echo Restoring $1 to $2
|
||||
tar -xf generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}/$1 $2
|
||||
else
|
||||
echo Skipping $1 - It is not present on disk
|
||||
fi
|
||||
}
|
||||
|
||||
# Restore generated artifacts
|
||||
mv_if_exist dist.zip src/out/Default
|
||||
mv_if_exist node_headers.tar.gz src/out/Default/gen
|
||||
mv_if_exist symbols.zip src/out/Default
|
||||
|
@ -19,4 +27,7 @@ mv_if_exist mksnapshot.zip src/out/Default
|
|||
mv_if_exist chromedriver.zip src/out/Default
|
||||
mv_if_exist ffmpeg.zip src/out/ffmpeg
|
||||
mv_if_exist hunspell_dictionaries.zip src/out/Default
|
||||
mv_if_exist cross-arch-snapshots src
|
||||
mv_if_exist cross-arch-snapshots src
|
||||
|
||||
# Restore build artifacts
|
||||
untar_if_exist build_artifacts.tar ./
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue