Skip to content

Commit 034b5f2

Browse files
committed
chore: include portal artifact checksum in manifest
1 parent 00def94 commit 034b5f2

2 files changed

Lines changed: 27 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ This command creates:
7171

7272
- `aruna-portal-dist.tar.gz`: static portal files at archive root, including `index.html`, `assets/`, `brand/`, and `portal-manifest.json`
7373
- `aruna-portal-dist.tar.gz.sha256`: SHA-256 checksum for the tarball
74-
- `portal-manifest.json`: release metadata consumed by Aruna `/api/v1/info.portal`
74+
- `portal-manifest.json`: release metadata, including the tarball SHA-256, consumed by Aruna `/api/v1/info.portal`
7575

76-
The manifest contains the portal name, package version, source git commit/ref, build time, and source repository reference.
76+
The standalone release manifest contains the portal name, package version, source git commit/ref, build time, source repository reference, and `artifact_sha256`. The copy inside the tarball omits `artifact_sha256` because the tarball checksum cannot be embedded inside the archive without making the checksum self-referential.
7777

7878
## GitHub Actions
7979

scripts/build-dist-tarball.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fi
3232
GIT_COMMIT="${GITHUB_SHA:-$(git rev-parse HEAD)}"
3333
GIT_REF="${GITHUB_REF_NAME:-$(git rev-parse --abbrev-ref HEAD)}"
3434
BUILT_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
35-
SOURCE="${PORTAL_SOURCE:-ArunaStorage/website@${GIT_REF}}"
35+
SOURCE="${PORTAL_SOURCE:-arunaengine/website@${GIT_REF}}"
3636

3737
json_escape() {
3838
local value="$1"
@@ -42,20 +42,33 @@ json_escape() {
4242
printf '%s' "$value"
4343
}
4444

45-
{
46-
printf '{\n'
47-
printf ' "name": "aruna-portal",\n'
48-
printf ' "version": "%s",\n' "$(json_escape "$VERSION")"
49-
printf ' "git_commit": "%s",\n' "$(json_escape "$GIT_COMMIT")"
50-
printf ' "git_ref": "%s",\n' "$(json_escape "$GIT_REF")"
51-
printf ' "built_at": "%s",\n' "$(json_escape "$BUILT_AT")"
52-
printf ' "source": "%s"\n' "$(json_escape "$SOURCE")"
53-
printf '}\n'
54-
} > "$MANIFEST"
45+
write_manifest() {
46+
local artifact_sha256="${1:-}"
47+
{
48+
printf '{\n'
49+
printf ' "name": "aruna-portal",\n'
50+
printf ' "version": "%s",\n' "$(json_escape "$VERSION")"
51+
printf ' "git_commit": "%s",\n' "$(json_escape "$GIT_COMMIT")"
52+
printf ' "git_ref": "%s",\n' "$(json_escape "$GIT_REF")"
53+
printf ' "built_at": "%s",\n' "$(json_escape "$BUILT_AT")"
54+
printf ' "source": "%s"' "$(json_escape "$SOURCE")"
55+
if [ -n "$artifact_sha256" ]; then
56+
printf ',\n'
57+
printf ' "artifact_sha256": "%s"\n' "$(json_escape "$artifact_sha256")"
58+
else
59+
printf '\n'
60+
fi
61+
printf '}\n'
62+
} > "$MANIFEST"
63+
}
64+
65+
write_manifest
5566
cp "$MANIFEST" "dist/$MANIFEST"
5667

5768
tar -C dist -czf "$TARBALL" .
58-
sha256sum "$TARBALL" > "$SHA_FILE"
69+
ARTIFACT_SHA256="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
70+
printf '%s %s\n' "$ARTIFACT_SHA256" "$TARBALL" > "$SHA_FILE"
71+
write_manifest "$ARTIFACT_SHA256"
5972

6073
echo "artifact=$ROOT/$TARBALL"
6174
echo "checksum=$ROOT/$SHA_FILE"

0 commit comments

Comments
 (0)