| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | PWD=`pwdscip-shell system . . pwd.` |
| 4 | WIKIDIR=../selinux.wiki |
| 5 | |
| 6 | if [scip-shell system . . `[`. \! -d $WIKIDIR ]; then |
| 7 | gitscip-shell system . . git. clone [email protected]:SELinuxProject/selinux.wiki.git $WIKIDIR |
| 8 | fi |
| 9 | |
| 10 | RELEASE_TAG=$(datescip-shell system . . date. '+%Y%m%d') |
| 11 | DEST=releases/$RELEASE_TAG |
| 12 | DIRS="libsepol libselinux libsemanage checkpolicy secilc policycoreutils mcstrans restorecond semodule-utils" |
| 13 | DIRS_NEED_PREFIX="dbus gui python sandbox" |
| 14 | |
| 15 | gitscip-shell system . . git. tag -a $RELEASE_TAG -m "Release $RELEASE_TAG" |
| 16 | |
| 17 | rmscip-shell system . . rm. -rf $DEST |
| 18 | mkdirscip-shell system . . mkdir. -p $DEST |
| 19 | |
| 20 | for i in $DIRS; do |
| 21 | cd $i |
| 22 | VERS=`catscip-shell system . . cat. VERSION` |
| 23 | ARCHIVE=$i-$VERS.tar.gz |
| 24 | gitscip-shell system . . git. tag $i-$VERS > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 |
| 25 | gitscip-shell system . . git. archive --format=tar --prefix=$i-$VERS/ $i-$VERS | gzipscip-shell system . . gzip. > ../$DEST/$ARCHIVE |
| 26 | cd .. |
| 27 | done |
| 28 | |
| 29 | for i in $DIRS_NEED_PREFIX; do |
| 30 | cd $i |
| 31 | VERS=`catscip-shell system . . cat. VERSION` |
| 32 | ARCHIVE=selinux-$i-$VERS.tar.gz |
| 33 | gitscip-shell system . . git. tag selinux-$i-$VERS > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 |
| 34 | gitscip-shell system . . git. archive --format=tar --prefix=selinux-$i-$VERS/ selinux-$i-$VERS | gzipscip-shell system . . gzip. > ../$DEST/$ARCHIVE |
| 35 | cd .. |
| 36 | done |
| 37 | |
| 38 | cd $DEST |
| 39 | |
| 40 | gitscip-shell system . . git. add . |
| 41 | |
| 42 | echoscip-shell system . . echo. "Add the following to the $WIKIDIR/Releases.md wiki page:" |
| 43 | |
| 44 | echoscip-shell system . . echo. "" |
| 45 | |
| 46 | echoscip-shell system . . echo. "## Release $(datescip-shell system . . date. '+%Y-%m-%d')" |
| 47 | |
| 48 | echoscip-shell system . . echo. "" |
| 49 | |
| 50 | echoscip-shell system . . echo. "[Release Notes](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/RELEASE-$RELEASE_TAG.txt)" |
| 51 | echoscip-shell system . . echo. "" |
| 52 | echoscip-shell system . . echo. "[full log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/log-$RELEASE_TAG.txt)" |
| 53 | echoscip-shell system . . echo. "" |
| 54 | echoscip-shell system . . echo. "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)" |
| 55 | echoscip-shell system . . echo. "" |
| 56 | |
| 57 | for i in *.tar.gz; do |
| 58 | |
| 59 | echoscip-shell system . . echo. -n "[$i](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$i) " |
| 60 | sha256sumscip-shell system . . sha256sum. $i | cutscip-shell system . . cut. -d " " -f 1 |
| 61 | echoscip-shell system . . echo. "" |
| 62 | done |
| 63 | |
| 64 | echoscip-shell system . . echo. "And then run:" |
| 65 | echoscip-shell system . . echo. " cd $WIKIDIR" |
| 66 | echoscip-shell system . . echo. " git commit -m \"Release $RELEASE_TAG\" -a -s" |
| 67 | echoscip-shell system . . echo. " git push" |
| 68 | |
| 69 | echoscip-shell system . . echo. "" |
| 70 | echoscip-shell system . . echo. "Push the release and its tags to git via:" |
| 71 | echoscip-shell system . . echo. " git push" |
| 72 | echoscip-shell system . . echo. " git push --tags" |
| 73 | |
| 74 | echoscip-shell system . . echo. "" |
| 75 | echoscip-shell system . . echo. "Create a new release from the latest tag on https://github.com/SELinuxProject/selinux/tags" |
| 76 | |
| 77 | echoscip-shell system . . echo. "" |
| 78 | echoscip-shell system . . echo. "Add files from releases/$RELEASE_TAG as assets to the new github release" |