Build and deploy StartOS package / build (push) Failing after 1m3s
30 lines
790 B
Bash
Executable File
30 lines
790 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
tag="${1:-}"
|
|
|
|
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(_[0-9]+)$ ]]; then
|
|
echo "Invalid release tag '${tag}'. Expected vMAJOR.MINOR.PATCH_WRAPPER, for example v0.2.0_0." >&2
|
|
exit 1
|
|
fi
|
|
|
|
package_version="$({
|
|
sed -n "s/^[[:space:]]*version: '\([^']*\)'.*/\1/p" \
|
|
startos/versions/current.ts
|
|
} | head -n 1)"
|
|
|
|
if [[ -z "${package_version}" ]]; then
|
|
echo "Could not read the package version from startos/versions/current.ts." >&2
|
|
exit 1
|
|
fi
|
|
|
|
expected_tag="v${package_version/:/_}"
|
|
|
|
if [[ "${tag}" != "${expected_tag}" ]]; then
|
|
echo "Release tag '${tag}' does not match package version '${package_version}'." >&2
|
|
echo "Expected tag: ${expected_tag}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Release tag ${tag} matches package version ${package_version}."
|