Release: cut over Echoion 2.0 components
Modular container CI / release-build (push) Has been cancelled
Modular container CI / release-build (push) Has been cancelled
This commit is contained in:
169 files changed
+3069
-32261
No files matched your search
+133
-135
@@ -11,20 +11,18 @@ Options:
|
||||
--jobs N Parallel build jobs
|
||||
--skip-tests Skip CTest and frontend tests
|
||||
--no-clean Reuse the configured build directory
|
||||
--update-url URL Emit an unsigned runtime feed payload for this artifact
|
||||
--update-channel NAME
|
||||
Feed channel (default: stable)
|
||||
--update-feed-id NAME
|
||||
Feed identifier (default: echoion-runtime)
|
||||
Component package channel (default: stable)
|
||||
--update-sequence N
|
||||
Monotonic feed sequence (default: SOURCE_DATE_EPOCH)
|
||||
--update-valid-days N
|
||||
Feed lifetime in days (default: 30)
|
||||
Monotonic component sequence (default: SOURCE_DATE_EPOCH)
|
||||
--official-update-feed-url URL
|
||||
HTTPS aggregate feed embedded as the official default
|
||||
HTTPS channel catalog embedded as the official default
|
||||
--void-source DIR Use an explicit VoidLibrary source tree
|
||||
--void-teamspeak-source DIR
|
||||
Use an explicit VoidTeamspeak source tree
|
||||
--component-workspace DIR
|
||||
Directory containing the nine permanent component repos
|
||||
(default: parent of this Echoion checkout)
|
||||
--container Build with containers/release.Dockerfile (the default)
|
||||
--host Explicitly build directly on this host
|
||||
-h, --help Show this help
|
||||
@@ -70,14 +68,12 @@ jobs=
|
||||
run_tests=1
|
||||
clean_build=1
|
||||
use_container=1
|
||||
update_url=
|
||||
update_channel=stable
|
||||
update_feed_id=echoion-runtime
|
||||
update_sequence=
|
||||
update_valid_days=30
|
||||
official_update_feed_url=
|
||||
void_source=
|
||||
void_teamspeak_source=
|
||||
component_workspace=$(dirname -- "$source_dir")
|
||||
|
||||
while (($#)); do
|
||||
case $1 in
|
||||
@@ -109,31 +105,16 @@ while (($#)); do
|
||||
clean_build=0
|
||||
shift
|
||||
;;
|
||||
--update-url)
|
||||
(($# >= 2)) || die "--update-url requires a value"
|
||||
update_url=$2
|
||||
shift 2
|
||||
;;
|
||||
--update-channel)
|
||||
(($# >= 2)) || die "--update-channel requires a value"
|
||||
update_channel=$2
|
||||
shift 2
|
||||
;;
|
||||
--update-feed-id)
|
||||
(($# >= 2)) || die "--update-feed-id requires a value"
|
||||
update_feed_id=$2
|
||||
shift 2
|
||||
;;
|
||||
--update-sequence)
|
||||
(($# >= 2)) || die "--update-sequence requires a value"
|
||||
update_sequence=$2
|
||||
shift 2
|
||||
;;
|
||||
--update-valid-days)
|
||||
(($# >= 2)) || die "--update-valid-days requires a value"
|
||||
update_valid_days=$2
|
||||
shift 2
|
||||
;;
|
||||
--official-update-feed-url)
|
||||
(($# >= 2)) || die "--official-update-feed-url requires a value"
|
||||
official_update_feed_url=$2
|
||||
@@ -149,6 +130,11 @@ while (($#)); do
|
||||
void_teamspeak_source=$2
|
||||
shift 2
|
||||
;;
|
||||
--component-workspace)
|
||||
(($# >= 2)) || die "--component-workspace requires a value"
|
||||
component_workspace=$2
|
||||
shift 2
|
||||
;;
|
||||
--container)
|
||||
use_container=1
|
||||
shift
|
||||
@@ -176,18 +162,15 @@ if [[ -n $jobs && ! $jobs =~ ^[1-9][0-9]*$ ]]; then
|
||||
fi
|
||||
[[ $update_channel =~ ^[A-Za-z0-9][A-Za-z0-9._-]{0,255}$ ]] ||
|
||||
die "--update-channel contains unsupported characters"
|
||||
[[ $update_feed_id =~ ^[A-Za-z0-9][A-Za-z0-9._-]{0,255}$ ]] ||
|
||||
die "--update-feed-id contains unsupported characters"
|
||||
[[ -z $update_sequence || $update_sequence =~ ^[0-9]+$ ]] ||
|
||||
die "--update-sequence must be a non-negative integer"
|
||||
[[ $update_valid_days =~ ^[1-9][0-9]*$ && $update_valid_days -le 365 ]] ||
|
||||
die "--update-valid-days must be between 1 and 365"
|
||||
[[ -z $official_update_feed_url ||
|
||||
$official_update_feed_url == https://* ]] ||
|
||||
die "--official-update-feed-url must use HTTPS"
|
||||
|
||||
build_dir=$(realpath -m -- "$build_dir")
|
||||
dist_dir=$(realpath -m -- "$dist_dir")
|
||||
component_workspace=$(realpath -e -- "$component_workspace")
|
||||
if [[ -n $void_source ]]; then
|
||||
void_source=$(realpath -e -- "$void_source")
|
||||
[[ -d $void_source && -f $void_source/CMakeLists.txt ]] ||
|
||||
@@ -198,6 +181,22 @@ if [[ -n $void_teamspeak_source ]]; then
|
||||
[[ -d $void_teamspeak_source && -f $void_teamspeak_source/CMakeLists.txt ]] ||
|
||||
die "--void-teamspeak-source must name a VoidTeamspeak source directory"
|
||||
fi
|
||||
component_ids=(
|
||||
EchoionApi
|
||||
EchoionCore
|
||||
EchoionDesktop
|
||||
EchoionHost
|
||||
EchoionPluginUrlShortenerExternal
|
||||
EchoionPluginUrlShortenerInternal
|
||||
EchoionStandalone
|
||||
EchoionUpdater
|
||||
EchoionWeb
|
||||
)
|
||||
for component_id in "${component_ids[@]}"; do
|
||||
[[ -f $component_workspace/$component_id/CMakeLists.txt &&
|
||||
-d $component_workspace/$component_id/.git ]] ||
|
||||
die "missing permanent component repository: $component_workspace/$component_id"
|
||||
done
|
||||
|
||||
container_path() {
|
||||
local path=$1
|
||||
@@ -238,6 +237,15 @@ if ((use_container)); then
|
||||
--env HOME=/tmp/echoion-release-home
|
||||
--env npm_config_cache=/tmp/echoion-npm-cache
|
||||
)
|
||||
for component_id in "${component_ids[@]}"; do
|
||||
docker_component_source=$(
|
||||
docker_daemon_path "$component_workspace/$component_id"
|
||||
)
|
||||
container_args+=(
|
||||
--volume
|
||||
"$docker_component_source:/workspace-components/$component_id"
|
||||
)
|
||||
done
|
||||
container_args+=("${proxy_run_args[@]}")
|
||||
if [[ -n $void_source ]]; then
|
||||
docker_void_source=$(docker_daemon_path "$void_source")
|
||||
@@ -259,6 +267,7 @@ if ((use_container)); then
|
||||
--version "$version"
|
||||
--build-dir "$container_build_dir"
|
||||
--dist-dir "$container_dist_dir"
|
||||
--component-workspace /workspace-components
|
||||
)
|
||||
[[ -n $jobs ]] && release_args+=(--jobs "$jobs")
|
||||
((run_tests)) || release_args+=(--skip-tests)
|
||||
@@ -267,16 +276,9 @@ if ((use_container)); then
|
||||
release_args+=(--void-source /workspace-deps/VoidLibrary)
|
||||
[[ -z $void_teamspeak_source ]] ||
|
||||
release_args+=(--void-teamspeak-source /workspace-deps/VoidTeamspeak)
|
||||
if [[ -n $update_url ]]; then
|
||||
release_args+=(
|
||||
--update-url "$update_url"
|
||||
--update-channel "$update_channel"
|
||||
--update-feed-id "$update_feed_id"
|
||||
--update-valid-days "$update_valid_days"
|
||||
)
|
||||
[[ -z $update_sequence ]] ||
|
||||
release_args+=(--update-sequence "$update_sequence")
|
||||
fi
|
||||
release_args+=(--update-channel "$update_channel")
|
||||
[[ -z $update_sequence ]] ||
|
||||
release_args+=(--update-sequence "$update_sequence")
|
||||
[[ -z $official_update_feed_url ]] ||
|
||||
release_args+=(
|
||||
--official-update-feed-url "$official_update_feed_url"
|
||||
@@ -300,7 +302,7 @@ case "$(uname -s)/$(uname -m)" in
|
||||
esac
|
||||
|
||||
required_commands=(
|
||||
cmake ninja npm python3 patchelf readelf tar zstd gzip sha256sum openssl
|
||||
cmake file ninja npm python3 patchelf readelf tar zstd gzip sha256sum openssl
|
||||
dpkg-query ldconfig
|
||||
)
|
||||
for command_name in "${required_commands[@]}"; do
|
||||
@@ -340,10 +342,18 @@ configure_args=(
|
||||
-B "$build_dir"
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DECHOION_STATIC_LINK=OFF
|
||||
-DECHOION_RELEASE_BUILD=ON
|
||||
-DECHOION_REPRODUCIBLE_BUILD=ON
|
||||
"-DECHOION_RELEASE_VERSION=$version"
|
||||
"-DECHOION_RUNTIME_VERSION=$version"
|
||||
"-DECHOION_TOOLCHAIN_ABI=linux-x86_64-glibc-2.35-cxx26"
|
||||
"-DECHOION_COMPONENT_WORKSPACE=$component_workspace"
|
||||
)
|
||||
for component_id in "${component_ids[@]}"; do
|
||||
configure_args+=(
|
||||
"-DCPM_${component_id}_SOURCE=$component_workspace/$component_id"
|
||||
)
|
||||
done
|
||||
official_update_keys="$source_dir/.gitea/release-keys/official-update-keys.json"
|
||||
[[ -f $official_update_keys ]] ||
|
||||
die "official update trust store is missing: $official_update_keys"
|
||||
@@ -360,8 +370,9 @@ configure_args+=(
|
||||
configure_args+=("-DCPM_Void_SOURCE=$void_source")
|
||||
[[ -z $void_teamspeak_source ]] ||
|
||||
configure_args+=("-DCPM_VoidTeamspeak_SOURCE=$void_teamspeak_source")
|
||||
npm --prefix "$source_dir/EchoionWeb/frontend" ci --no-audit --no-fund
|
||||
cmake -E rm -rf "$source_dir/EchoionWeb/frontend/web-dist"
|
||||
web_frontend="$component_workspace/EchoionWeb/frontend"
|
||||
npm --prefix "$web_frontend" ci --no-audit --no-fund
|
||||
cmake -E rm -rf "$web_frontend/web-dist"
|
||||
(
|
||||
cd "$source_dir"
|
||||
cmake "${configure_args[@]}"
|
||||
@@ -372,8 +383,8 @@ cmake "${build_args[@]}"
|
||||
|
||||
if ((run_tests)); then
|
||||
ctest --test-dir "$build_dir" --build-config Release --output-on-failure
|
||||
npm --prefix "$source_dir/EchoionWeb/frontend" test
|
||||
npm --prefix "$source_dir/EchoionWeb/frontend" run i18n:check
|
||||
npm --prefix "$web_frontend" test
|
||||
npm --prefix "$web_frontend" run i18n:check
|
||||
fi
|
||||
|
||||
stage="$build_dir/runtime-stage"
|
||||
@@ -454,11 +465,15 @@ collect_licenses() {
|
||||
local destination=$1
|
||||
local candidate relative package_name license_name digest target package source_path soname
|
||||
local -a license_roots=(
|
||||
"$source_dir/EchoionApi"
|
||||
"$source_dir/EchoionCore"
|
||||
"$source_dir/EchoionHost"
|
||||
"$source_dir/EchoionStandalone"
|
||||
"$source_dir/EchoionWeb"
|
||||
"$component_workspace/EchoionApi"
|
||||
"$component_workspace/EchoionCore"
|
||||
"$component_workspace/EchoionHost"
|
||||
"$component_workspace/EchoionStandalone"
|
||||
"$component_workspace/EchoionWeb"
|
||||
"$component_workspace/EchoionUpdater"
|
||||
"$component_workspace/EchoionDesktop"
|
||||
"$component_workspace/EchoionPluginUrlShortenerInternal"
|
||||
"$component_workspace/EchoionPluginUrlShortenerExternal"
|
||||
"$build_dir/_deps"
|
||||
)
|
||||
if [[ -n ${GCC_ROOT:-} && -d $GCC_ROOT/share/licenses ]]; then
|
||||
@@ -531,7 +546,7 @@ collect_licenses() {
|
||||
|
||||
collect_licenses "$stage/share/echoion/licenses"
|
||||
python3 "$source_dir/scripts/collect-frontend-licenses.py" \
|
||||
--node-modules "$source_dir/EchoionWeb/frontend/node_modules" \
|
||||
--node-modules "$web_frontend/node_modules" \
|
||||
--output "$stage/share/echoion/licenses/frontend"
|
||||
|
||||
python3 "$source_dir/scripts/generate-release-manifest.py" \
|
||||
@@ -545,26 +560,66 @@ install -m 0755 "$source_dir/packaging/install.sh" "$stage/install.sh"
|
||||
install -m 0755 "$source_dir/packaging/uninstall.sh" "$stage/uninstall.sh"
|
||||
|
||||
mkdir -p "$dist_dir"
|
||||
component_stage_root="$build_dir/component-staging"
|
||||
safe_remove_tree "$component_stage_root"
|
||||
mkdir -p "$component_stage_root"
|
||||
while IFS=$'\t' read -r component_id package_id; do
|
||||
component_root="$component_stage_root/$package_id"
|
||||
cmake --install "$build_dir" \
|
||||
--config Release \
|
||||
--component "Package${component_id}" \
|
||||
--prefix "$component_root"
|
||||
|
||||
component_executables=()
|
||||
component_libraries=()
|
||||
while IFS= read -r -d '' component_elf; do
|
||||
case $(file --brief --mime-type "$component_elf") in
|
||||
application/x-executable|application/x-pie-executable|application/x-sharedlib) ;;
|
||||
*) continue ;;
|
||||
esac
|
||||
case ${component_elf#"$component_root"/} in
|
||||
bin/*) component_executables+=("$component_elf") ;;
|
||||
*) component_libraries+=("$component_elf") ;;
|
||||
esac
|
||||
done < <(
|
||||
find "$component_root" -type f -print0 | LC_ALL=C sort -z
|
||||
)
|
||||
if ((${#component_executables[@]} || ${#component_libraries[@]})); then
|
||||
component_executable_list=$(
|
||||
IFS=';'
|
||||
echo "${component_executables[*]}"
|
||||
)
|
||||
component_library_list=$(
|
||||
IFS=';'
|
||||
echo "${component_libraries[*]}"
|
||||
)
|
||||
cmake \
|
||||
"-DBUNDLE_ROOT=$component_root" \
|
||||
"-DBUNDLE_EXECUTABLES=$component_executable_list" \
|
||||
"-DBUNDLE_LIBRARIES=$component_library_list" \
|
||||
"-DBUNDLE_SEARCH_DIRECTORIES=$search_directories" \
|
||||
"-DBUNDLE_SEED_FILES=$compiler_runtimes" \
|
||||
"-DPATCHELF_EXECUTABLE=$(command -v patchelf)" \
|
||||
-P "$source_dir/cmake/BundleComponentDependencies.cmake"
|
||||
fi
|
||||
done < <(
|
||||
python3 -c \
|
||||
'import json,sys; data=json.load(open(sys.argv[1], encoding="utf-8"))["components"]; [print(name, data[name]["packageId"], sep="\t") for name in sorted(data)]' \
|
||||
"$source_dir/components.json"
|
||||
)
|
||||
|
||||
artifact_base="echoion-${version}-linux-x86_64"
|
||||
archive="$dist_dir/$artifact_base.tar.zst"
|
||||
installer="$dist_dir/$artifact_base.run"
|
||||
external_manifest="$dist_dir/$artifact_base.manifest.json"
|
||||
external_report="$dist_dir/$artifact_base.dependencies.txt"
|
||||
feed_payload="$dist_dir/$artifact_base.update-payload.json"
|
||||
core_artifact="$dist_dir/echoion-core-${version}-linux-x86_64.so"
|
||||
core_feed_payload="$dist_dir/echoion-core-${version}-linux-x86_64.update-payload.json"
|
||||
internal_plugin_artifact="$dist_dir/url-shortener-internal-${version}-linux-x86_64.so"
|
||||
internal_plugin_feed_payload="$dist_dir/url-shortener-internal-${version}-linux-x86_64.update-payload.json"
|
||||
external_plugin_artifact="$dist_dir/url-shortener-external-${version}-linux-x86_64.so"
|
||||
external_plugin_feed_payload="$dist_dir/url-shortener-external-${version}-linux-x86_64.update-payload.json"
|
||||
component_dist="$dist_dir/components"
|
||||
rm -f -- \
|
||||
"$archive" "$archive.tmp" \
|
||||
"$installer" "$installer.tmp" \
|
||||
"$external_manifest" "$external_report" "$feed_payload" \
|
||||
"$core_artifact" "$core_feed_payload" \
|
||||
"$internal_plugin_artifact" "$internal_plugin_feed_payload" \
|
||||
"$external_plugin_artifact" "$external_plugin_feed_payload" \
|
||||
"$external_manifest" "$external_report" \
|
||||
"$dist_dir/SHA256SUMS"
|
||||
cmake -E rm -rf "$component_dist"
|
||||
|
||||
bash "$source_dir/scripts/package-release-payload.sh" \
|
||||
"$stage" "$artifact_base" "$SOURCE_DATE_EPOCH" \
|
||||
@@ -572,73 +627,24 @@ bash "$source_dir/scripts/package-release-payload.sh" \
|
||||
|
||||
install -m 0644 "$stage/manifest.json" "$external_manifest"
|
||||
install -m 0644 "$dependency_report" "$external_report"
|
||||
install -m 0644 "$stage/lib/Echoion.ts" "$core_artifact"
|
||||
install -m 0644 \
|
||||
"$stage/share/echoion/bootstrap-plugins/url-shortener-internal/$version/url-shortener-internal.so" \
|
||||
"$internal_plugin_artifact"
|
||||
install -m 0644 \
|
||||
"$stage/share/echoion/bootstrap-plugins/url-shortener-external/$version/url-shortener-external.so" \
|
||||
"$external_plugin_artifact"
|
||||
if [[ -n $update_url ]]; then
|
||||
feed_args=(
|
||||
--artifact "$archive"
|
||||
--manifest "$external_manifest"
|
||||
--version "$version"
|
||||
--url "$update_url"
|
||||
--channel "$update_channel"
|
||||
--feed-id "$update_feed_id"
|
||||
--valid-days "$update_valid_days"
|
||||
--output-payload "$feed_payload"
|
||||
)
|
||||
[[ -z $update_sequence ]] ||
|
||||
feed_args+=(--sequence "$update_sequence")
|
||||
python3 "$source_dir/scripts/generate-update-feed.py" "${feed_args[@]}"
|
||||
artifact_url_root=${update_url%/*}
|
||||
component_feed_args=(
|
||||
--version "$version"
|
||||
--channel "$update_channel"
|
||||
--feed-id "$update_feed_id"
|
||||
--valid-days "$update_valid_days"
|
||||
)
|
||||
[[ -z $update_sequence ]] ||
|
||||
component_feed_args+=(--sequence "$update_sequence")
|
||||
python3 "$source_dir/scripts/generate-update-feed.py" \
|
||||
--artifact "$core_artifact" \
|
||||
--component core \
|
||||
--url "$artifact_url_root/$(basename "$core_artifact")" \
|
||||
--output-payload "$core_feed_payload" \
|
||||
"${component_feed_args[@]}"
|
||||
python3 "$source_dir/scripts/generate-update-feed.py" \
|
||||
--artifact "$internal_plugin_artifact" \
|
||||
--component plugin \
|
||||
--artifact-id url-shortener-internal \
|
||||
--url "$artifact_url_root/$(basename "$internal_plugin_artifact")" \
|
||||
--output-payload "$internal_plugin_feed_payload" \
|
||||
"${component_feed_args[@]}"
|
||||
python3 "$source_dir/scripts/generate-update-feed.py" \
|
||||
--artifact "$external_plugin_artifact" \
|
||||
--component plugin \
|
||||
--artifact-id url-shortener-external \
|
||||
--url "$artifact_url_root/$(basename "$external_plugin_artifact")" \
|
||||
--output-payload "$external_plugin_feed_payload" \
|
||||
"${component_feed_args[@]}"
|
||||
component_sequence=${update_sequence:-$SOURCE_DATE_EPOCH}
|
||||
if [[ $component_sequence == 0 ]]; then
|
||||
component_sequence=1
|
||||
fi
|
||||
python3 "$source_dir/scripts/package-components.py" \
|
||||
--registry "$source_dir/components.json" \
|
||||
--lock "$source_dir/components.lock.json" \
|
||||
--staging-root "$component_stage_root" \
|
||||
--output "$component_dist" \
|
||||
--channel "$update_channel" \
|
||||
--sequence "$component_sequence" \
|
||||
--product-version "$version" \
|
||||
--toolchain-contract linux-x86_64-glibc-2.35-cxx26
|
||||
(
|
||||
cd "$dist_dir"
|
||||
checksum_files=(
|
||||
"$(basename "$archive")" \
|
||||
"$(basename "$installer")" \
|
||||
"$(basename "$external_manifest")" \
|
||||
"$(basename "$external_report")" \
|
||||
"$(basename "$core_artifact")" \
|
||||
"$(basename "$internal_plugin_artifact")" \
|
||||
"$(basename "$external_plugin_artifact")"
|
||||
)
|
||||
[[ -z $update_url ]] || checksum_files+=(
|
||||
"$(basename "$feed_payload")"
|
||||
"$(basename "$core_feed_payload")"
|
||||
"$(basename "$internal_plugin_feed_payload")"
|
||||
"$(basename "$external_plugin_feed_payload")"
|
||||
mapfile -t checksum_files < <(
|
||||
find . -type f ! -name SHA256SUMS -printf '%P\n' |
|
||||
LC_ALL=C sort
|
||||
)
|
||||
sha256sum "${checksum_files[@]}" >SHA256SUMS
|
||||
)
|
||||
@@ -648,13 +654,5 @@ echo " $archive"
|
||||
echo " $installer"
|
||||
echo " $external_manifest"
|
||||
echo " $external_report"
|
||||
echo " $core_artifact"
|
||||
echo " $internal_plugin_artifact"
|
||||
echo " $external_plugin_artifact"
|
||||
if [[ -n $update_url ]]; then
|
||||
echo " $feed_payload"
|
||||
echo " $core_feed_payload"
|
||||
echo " $internal_plugin_feed_payload"
|
||||
echo " $external_plugin_feed_payload"
|
||||
fi
|
||||
echo " $component_dist"
|
||||
echo " $dist_dir/SHA256SUMS"
|
||||
Reference in new issue
Block a user