-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease
More file actions
executable file
·49 lines (36 loc) · 1 KB
/
release
File metadata and controls
executable file
·49 lines (36 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
export V=$1
export DZIL_RELEASE=1
# Ensure release version is explicit
if [ ! -n "$V" ]; then
echo 'No release version!' && exit 0;
fi
# Check the repo is in ready-state
if ! git diff-index --quiet HEAD --; then
echo "Uncommitted changes!" && exit 0;
fi
# Test fake build before release
if ! dzil test; then
echo "Build test failed!" && exit 0;
fi
# Cleanup the mess
dzil clean
# Delete existing release tag (if exists)
git tag -d cpan $V 2> /dev/null
git push origin :refs/tags/cpan :refs/tags/$V 2> /dev/null
# Persist Release VERSION
echo $V > VERSION
# Delete existing POD documents
find lib -type f -name \*.pod -exec rm {} \;
# Regenerate all necessary POD documents
testauto -o lib -t TEMPLATE
# Push generated POD changes
if ! git diff-index --quiet HEAD --; then
git add . && git commit -m 'Added release updates'
fi
# Build, Tag, and Push Package Release
dzil release
# Tag as CPAN for releasing
git tag cpan 2> /dev/null
# Re-push all tags (just in case)
git push --tags 2> /dev/null