Skip to content

Commit a05b355

Browse files
committed
mk/{package,publish.sh}: Do extra last-instant dirty repo checks.
`--allow-dirty` doesn't allow us to be as granular as we'd like; see rust-lang/cargo#9398 (comment). This isn't foolproof but it gets us closer to what we want. The new `mk/publish.sh` is a step towards more robust publishing with tagging, etc.
1 parent abbd7e8 commit a05b355

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

mk/package.sh

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ fi
1212
cargo clean --target-dir=target/pregenerate_asm
1313
RING_PREGENERATE_ASM=1 CC_AARCH64_PC_WINDOWS_MSVC=clang \
1414
cargo build -p ring --target-dir=target/pregenerate_asm
15+
if [[ -n "$(git status --porcelain -- ':(exclude)pregenerated/')" ]]; then
16+
echo Repository is dirty.
17+
exit 1
18+
fi
1519
cargo package -p ring --allow-dirty

mk/publish.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set -eux -o pipefail
2+
IFS=$'\n\t'
3+
4+
# Make sure the current tree isn't dirty other than what's in pregenerated/.
5+
if [[ -n "$(git status --porcelain -- ':(exclude)pregenerated/')" ]]; then
6+
echo Repository is dirty.
7+
exit 1
8+
fi
9+
cargo publish -p ring --allow-dirty

0 commit comments

Comments
 (0)