-
Notifications
You must be signed in to change notification settings - Fork 369
/
Copy pathrelease
executable file
·104 lines (82 loc) · 2.58 KB
/
release
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Fail when a command fails
set -e
# Ensure the script is running from the top level directory
cd "$(dirname -- "$0")/.."
WIKIDIR=../selinux.wiki
if ! [ -d "$WIKIDIR" ]; then
git clone [email protected]:SELinuxProject/selinux.wiki.git "$WIKIDIR"
fi
RELEASE_TAG="$(cat VERSION)"
DEST="releases/$RELEASE_TAG"
DIRS=(
checkpolicy
libselinux
libsemanage
libsepol
mcstrans
policycoreutils
restorecond
secilc
selinux-dbus
selinux-gui
selinux-python
selinux-sandbox
semodule-utils
)
if git rev-parse "$RELEASE_TAG" &> /dev/null ; then
echo "Warning: tag $RELEASE_TAG already exists"
else
git tag -a "$RELEASE_TAG" -m "Release $RELEASE_TAG"
fi
rm -rf "$DEST"
mkdir -p "$DEST"
for COMPONENT in "${DIRS[@]}"; do
DIR="${COMPONENT#selinux-}"
VERS="$(cat "$DIR/VERSION")"
TAG="$COMPONENT-$VERS"
if git rev-parse "$TAG" &> /dev/null ; then
echo "Warning: tag $TAG already exists"
else
git tag "$TAG" > /dev/null
fi
git -C "$DIR" archive -o "../$DEST/$TAG.tar.gz" --prefix="$TAG/" "$TAG"
gpg -b -a "../$DEST/$TAG.tar.gz"
done
git archive -o "$DEST/selinux-${RELEASE_TAG}.tar.gz" --prefix="selinux-${RELEASE_TAG}/" "${RELEASE_TAG}"
echo "Add the following to the $WIKIDIR/Releases.md wiki page:"
echo ""
echo "## Release $RELEASE_TAG"
echo ""
echo "[Release Notes](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/RELEASE-$RELEASE_TAG.txt)"
echo ""
echo "[full log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/log-$RELEASE_TAG.txt)"
echo ""
echo "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)"
echo ""
for COMPONENT in "${DIRS[@]}"; do
DIR="${COMPONENT#selinux-}"
VERS="$(cat "$DIR/VERSION")"
TAG="$COMPONENT-$VERS"
tarball="$TAG.tar.gz"
echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
sha256sum "$DEST/$tarball" | cut -d " " -f 1
echo ""
done
echo "### Source repository snapshot"
echo ""
echo -n "[selinux-${RELEASE_TAG}.tar.gz](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/selinux-${RELEASE_TAG}.tar.gz) "
sha256sum "$DEST/selinux-${RELEASE_TAG}.tar.gz" | cut -d " " -f 1
echo ""
echo "And then run:"
echo " cd $WIKIDIR"
echo " git commit -m \"Release $RELEASE_TAG\" -a -s"
echo " git push"
echo ""
echo "Push the release and its tags to git via:"
echo " git push"
echo " git push --tags"
echo ""
echo "Create a new release from the latest tag on https://github.com/SELinuxProject/selinux/tags"
echo ""
echo "Add files from releases/$RELEASE_TAG as assets to the new github release"