Taken from oppi's goat repo
Publish artifacts
18 lines 644 B view raw
1#!/usr/bin/env bash 2set -e 3 4TAG_HASH=$(git rev-parse "$TAG"^{tag}) && 5TAG_BYTES=$(echo -n "$TAG_HASH" | xxd -r -p | base64 | tr -d '=') && 6BLOB_OUTPUT=$(./goat blob upload "$ARTIFACT_PATH") && 7echo "$BLOB_OUTPUT" && 8ARTIFACT_JSON=$(echo "$BLOB_OUTPUT" | jq --arg tag "$TAG_BYTES" --arg name "$ARTIFACT_NAME" --arg repo "$REPO_URL" --arg created "$(date -Iseconds)" '{ 9 "tag": {"$bytes": $tag}, 10 "name": $name, 11 "repo": $repo, 12 "$type": "sh.tangled.repo.artifact", 13 "artifact": ., 14 "createdAt": $created 15 }') && 16echo "$ARTIFACT_JSON" > temp_artifact.json && 17cat temp_artifact.json && 18./goat record create temp_artifact.json -n