1 parent
639362fbf5
commit
bdd69f0aad
101 files changed
+22691
-531
No files matched your search
@@ -10,17 +10,72 @@ source_root=$(realpath -e -- "$1")
|
||||
temporary=$(mktemp -d "${TMPDIR:-/tmp}/echoion-release-packaging.XXXXXX")
|
||||
trap 'rm -rf -- "$temporary"' EXIT
|
||||
|
||||
for version in 0.0.0 1.2.3 1.2.3-rc.1 10.20.30-beta.2; do
|
||||
python3 "$source_root/scripts/validate-semver.py" "$version"
|
||||
done
|
||||
for version in 01.2.3 1.2 1.2.3-01 not-a-version; do
|
||||
if python3 "$source_root/scripts/validate-semver.py" "$version" \
|
||||
>/dev/null 2>&1; then
|
||||
echo "invalid SemVer unexpectedly accepted: $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for version in 01.2.3 1.2.3-01; do
|
||||
release_error="$temporary/release-version-$version.error"
|
||||
if "$source_root/scripts/release.sh" \
|
||||
--version "$version" \
|
||||
--build-dir "$temporary/build" \
|
||||
--dist-dir "$temporary/dist" \
|
||||
>/dev/null 2>"$release_error"; then
|
||||
echo "release unexpectedly accepted a non-canonical version: $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -q 'canonical Semantic Versioning' "$release_error"
|
||||
done
|
||||
if "$source_root/scripts/release.sh" \
|
||||
--version 1.2.3+build \
|
||||
--build-dir "$temporary/build" \
|
||||
--dist-dir "$temporary/dist" \
|
||||
>/dev/null 2>&1; then
|
||||
echo "release unexpectedly accepted SemVer build metadata" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pythonless_path="$temporary/pythonless-path"
|
||||
mkdir "$pythonless_path"
|
||||
for command_name in bash dirname id realpath; do
|
||||
ln -s "$(command -v "$command_name")" "$pythonless_path/$command_name"
|
||||
done
|
||||
ln -s "$(type -P true)" "$pythonless_path/docker"
|
||||
if PATH="$pythonless_path" command -v python3 >/dev/null; then
|
||||
echo "Python unexpectedly exists in the container-host test PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
PATH="$pythonless_path" "$source_root/scripts/release.sh" \
|
||||
--version 1.2.3-rc.1 \
|
||||
--build-dir "$source_root/build-pythonless-container-probe" \
|
||||
--dist-dir "$source_root/dist-pythonless-container-probe" \
|
||||
--skip-tests
|
||||
|
||||
bundle="$temporary/bundle"
|
||||
mkdir -p \
|
||||
"$bundle/bin" \
|
||||
"$bundle/lib" \
|
||||
"$bundle/service" \
|
||||
"$bundle/share/echoion/web"
|
||||
"$bundle/share/echoion/web" \
|
||||
"$bundle/share/echoion/tools"
|
||||
install -m 0755 /bin/true "$bundle/bin/echoiond"
|
||||
install -m 0755 /bin/true "$bundle/bin/echoion-updater"
|
||||
install -m 0644 /bin/true "$bundle/lib/Echoion.ts"
|
||||
printf '%s\n' '<!doctype html><title>Echoion</title>' \
|
||||
>"$bundle/share/echoion/web/index.html"
|
||||
printf '%s\n' '[Service]' >"$bundle/service/echoion.service.in"
|
||||
printf '%s\n' '[Service]' >"$bundle/service/echoion-updater.service.in"
|
||||
printf '%s\n' '[Timer]' >"$bundle/service/echoion-updater.timer.in"
|
||||
printf '%s\n' '{}' >"$bundle/share/echoion/config.example.json"
|
||||
install -m 0755 "$source_root/scripts/validate-release-manifest.py" \
|
||||
"$bundle/share/echoion/tools/validate-release-manifest.py"
|
||||
ln -s Echoion.ts "$bundle/lib/Echoion-current.ts"
|
||||
|
||||
python3 "$source_root/scripts/generate-release-manifest.py" \
|
||||
@@ -57,6 +112,7 @@ with open(sys.argv[1], encoding="utf-8") as stream:
|
||||
assert manifest["schemaVersion"] == 2
|
||||
assert manifest["version"] == "1.2.3"
|
||||
assert manifest["executable"] == "bin/echoiond"
|
||||
assert manifest["updater"] == "bin/echoion-updater"
|
||||
assert manifest["core"] == "lib/Echoion.ts"
|
||||
paths = [entry["path"] for entry in manifest["files"]]
|
||||
assert paths == sorted(paths)
|
||||
|
||||
Reference in new issue
Block a user