From 47a8e895357fc986683023cc95d148e5d5bf8bfc Mon Sep 17 00:00:00 2001 From: Marc Redemske Date: Thu, 25 Jan 2024 12:13:17 +0100 Subject: [PATCH] chore: prepare release --- .gitattributes | 1 + .github/workflows/release.sh | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index ed47664..f7d215e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ .git* export-ignore .pre-commit-config.yaml export-ignore e2e export-ignore +*_test.bzl export-ignore diff --git a/.github/workflows/release.sh b/.github/workflows/release.sh index 6d9b6ac..2885d33 100755 --- a/.github/workflows/release.sh +++ b/.github/workflows/release.sh @@ -8,7 +8,23 @@ PREFIX="${NAME}-${VERSION}" RULES_ARCHIVE="${NAME}-${TAG}.tar.gz" echo -n "build: Create Rules Archive" -git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip >$RULES_ARCHIVE +MODULE_BAZEL_FILE="\ +module( + name = \"bzlparty_tools\", + version = \"${VERSION}\", + compatibility_level = 1, +) +bazel_dep(name = \"platforms\", version = \"0.0.8\") +" +PUBLIC_PACKAGE="\ +package(default_visibility = [\"//visibility:public\"]) +exports_files(glob([\"*.bzl\"])) +" +git archive --format=tar \ + --add-virtual-file=${PREFIX}/MODULE.bazel:"${MODULE_BAZEL_FILE}" \ + --add-virtual-file=${PREFIX}/BUILD.bazel:"package(default_visibility = [\"//visibility:public\"])" \ + --add-virtual-file=${PREFIX}/lib/BUILD.bazel:"${PUBLIC_PACKAGE}" \ + --prefix=${PREFIX}/ ${TAG} | gzip >$RULES_ARCHIVE RULES_SHA=$(shasum -a 256 $RULES_ARCHIVE | awk '{print $1}') echo " ... done ($RULES_ARCHIVE: $RULES_SHA)"