From 62b9f1e4e06b844cb76902d86f1be086d583c0c2 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Fri, 9 Feb 2024 20:55:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20New=20script=20for=20publishing?= =?UTF-8?q?=20crates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/publish.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 tools/publish.sh diff --git a/tools/publish.sh b/tools/publish.sh new file mode 100755 index 00000000..153cfbdb --- /dev/null +++ b/tools/publish.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +cd "$(dirname "$0")" +cd .. + +if [ -n "$(git status --porcelain)" ]; then + echo "You have local changes!" + exit 1 +fi + +function publish_crate() { + echo -e "\nPublishing ${crate}" + cp ../LICENSE-MIT "$crate" + cp ../LICENSE-APACHE "$crate" + pushd "$crate" + git add LICENSE-MIT LICENSE-APACHE +# cargo publish --no-verify --allow-dirty + cargo publish + popd + sleep 20 +} + +# If package A depends on package B, B must come before A in this list +helpers=( + pagetop-macros + pagetop-build +) +packages=( + pagetop-bootsier + pagetop-bulmix + pagetop-homedemo + pagetop-user + pagetop-admin + pagetop-node +) + +pushd helpers +for crate in "${helpers[@]}"; do publish_crate; done +popd + +echo "Publishing root crate" +#cargo publish --allow-dirty +cargo publish + +pushd packages +for crate in "${packages[@]}"; do publish_crate; done +popd + +echo "Cleaning local state" +git reset HEAD --hard