Skip to content

Commit d974dd5

Browse files
committed
Add check-if-release script
1 parent b84ffeb commit d974dd5

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

β€Žscripts/check-if-release.shβ€Ž

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
# Very basic script checking for the existence of a file 'release.properties' in
4+
# the root of the repository. If this is present, the state of the checkout
5+
# indicates this is a proper release made through the 'release-version.sh'
6+
# script from the 'scijava-scripts' repo. Will return false if the file is not
7+
# present, can be overridden with an environment variable.
8+
9+
# The idea is to include this in automated builds to prevent accidential
10+
# attempts of publishing non-releases to PyPI.
11+
12+
set -o errexit # exit on any error
13+
14+
PROPERTIES="release.properties"
15+
16+
test -n "$IGNORE_NO_RELEASE" &&
17+
echo "⚠ πŸ”€ NOT checking for file '$PROPERTIES'... ⚠" &&
18+
exit 0
19+
20+
cd "$(dirname "$0")/.."
21+
22+
echo "Checking if '$PROPERTIES' exists..."
23+
test -f "$PROPERTIES" && echo "All good βœ…" && exit 0
24+
25+
echo πŸ›‘πŸ›‘πŸ›‘
26+
echo '/-----------------------------------------------------\'
27+
echo "| Couldn't find 'release.properties', STOPPING build! |"
28+
echo "| To ignore this, add this to the environment: |"
29+
echo "| > export IGNORE_NO_RELEASE=true |"
30+
echo '\-----------------------------------------------------/'
31+
echo πŸ›‘πŸ›‘πŸ›‘
32+
33+
exit 1

0 commit comments

Comments
Β (0)