#!/bin/sh # Conformance source archive: fixtures and runners, not build artifacts. set -eu ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) export COMPONENT_ID=conformance export REPOSITORY=cflmy/marqdo-extension-conformance SOURCE_SHA=${SOURCE_SHA:-$(git -C "$ROOT" rev-parse HEAD)} OUT_DIR=${OUT_DIR:-dist} TAG=${CI_COMMIT_TAG:-${TAG:-}} if [ -n "${VERSION:-}" ]; then : elif [ -n "$TAG" ]; then VERSION=${TAG#v} else echo "package.sh: set VERSION or CI_COMMIT_TAG" >&2 exit 1 fi TAG=${TAG:-v$VERSION} python3 "$ROOT/scripts/release/package_source.py" \ --root "$ROOT" \ --component-id "$COMPONENT_ID" \ --version "$VERSION" \ --out-dir "$OUT_DIR" \ --allow tests \ --allow kernel \ --allow provider \ --allow plugin \ --allow evidence \ --allow README.md \ --allow LICENSE ARCHIVE=$(ls "$ROOT/$OUT_DIR"/marqdo-"$COMPONENT_ID"-"$VERSION"-source.tar.gz) DEP_ARGS="" if [ -n "${CLI_SOURCE_SHA:-}" ]; then DEP_ARGS="--dependency id=cli,source_sha=${CLI_SOURCE_SHA}" fi # shellcheck disable=SC2086 python3 "$ROOT/scripts/release/write_evidence.py" \ --component-id "$COMPONENT_ID" \ --repository "$REPOSITORY" \ --tag "$TAG" \ --source-sha "$SOURCE_SHA" \ --asset "$ARCHIVE" \ --asset "${ARCHIVE}.sha256" \ --out "$ROOT/$OUT_DIR/release-evidence.json" \ $DEP_ARGS echo "$ARCHIVE"