]> git.codecow.com Git - Monocypher.git/commitdiff
Tightened up the release script
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 19 Oct 2019 23:01:43 +0000 (01:01 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 19 Oct 2019 23:01:43 +0000 (01:01 +0200)
- Run tests/test.sh prior to release
- Removed the dist target from the shipped makefile
- Removed the contributor notes from the shipped README
- Don't include files that only serve to generate vectors.h
- Reworded some of README a little bit.

README.md
release.sh
tarball_ignore

index 02d75f8836ba99b8899af7de07835179f1c6a747..14896457c8e0fd23a20b774817693ff39ad1c556 100644 (file)
--- a/README.md
+++ b/README.md
@@ -18,11 +18,8 @@ The manual can be found at https://monocypher.org/manual/, and in the
 `doc/` folder.
 
 The `doc/man/` folder contains the man pages.  You can install them in
-your system by running `make install-doc`.
-
-Unless you cloned the git repository, there is a html version in
-`doc/html/`, that you can regenerate by executing the `doc/man2html.sh`
-script.  This requires mandoc.
+your system by running `make install-doc`. Official releases also have a
+`doc/html/` folder with an html version.
 
 
 Installation
@@ -31,17 +28,17 @@ Installation
 ### Option 1: grab the sources
 
 The easiest way to use Monocypher is to include `src/monocypher.h` and
-`src/monocypher.c` directly into your project.  They compile as C99,
-C11, C++98, C++11, C++14, and C++17.
+`src/monocypher.c` directly into your project.  They compile as C (since
+C99) and C++ (since C++98).
 
 
 ### Option 2: grab the library
 
-Alternatively, you can run `make`, then grab the `src/monocypher.h`
-header and the `lib/libmonocypher.a` or `lib/libmonocypher.so` library.
-The default compiler is `gcc -std=gnu99`, and the default flags are
-`-pedantic -Wall -Wextra -O3 -march=native`.  If they don't work on your
-platform, you can change them like this:
+Run `make`, then grab the `src/monocypher.h` header and either the
+`lib/libmonocypher.a` or `lib/libmonocypher.so` library.  The default
+compiler is `gcc -std=gnu99`, and the default flags are `-pedantic -Wall
+-Wextra -O3 -march=native`.  If they don't work on your platform, you
+can change them like this:
 
     $ make CC="clang -std=c99" CFLAGS="-O2"
 
@@ -82,7 +79,7 @@ somewhere.
 
 *Do not* use Monocypher without running those tests at least once.
 
-The same test suite can be run under clang sanitisers and valgrind, and
+The same test suite can be run under Clang sanitisers and Valgrind, and
 be checked for code coverage:
 
     $ tests/test.sh
@@ -174,8 +171,8 @@ option.  The binary will be about 5KB smaller, and in some cases faster.
 Contributor notes
 -----------------
 
-If you just cloned the GitHub repository, you will miss a couple files
-that ship with the tarball releases:
+If you are reading this, you cloned the GitHub repository.  You miss a
+couple files that ship with the tarball releases:
 
 - The `test/vectors.h` header.  Generating it requires Libsodium. Go
   to `test/gen/`, then run `make`.
index f5dbaf82f21cfd962f3415ac4bf0497695b2bca3..bcc55f8a38e12b617d0c56c71208747a4744aff0 100755 (executable)
@@ -3,12 +3,39 @@
 set -e
 
 VERSION=`git describe --tags`
+FOLDER=monocypher-$VERSION
+TARBALL=$FOLDER.tar.gz
 
+# Run the tests before we do anything.  It's not enough (we ought to run
+# the tests from the tarball itself, including the TIS interpreter), but
+# it should prevent the most egregious errors.
+tests/test.sh
+
+# Generate documentation for users who don't have mandoc
 doc/man2html.sh
-rsync -avd --exclude-from=tarball_ignore ./ monocypher-$VERSION
+
+# Delete the destination folder just to make sure everything is clean.
+# May be needed if we unpack the tarball in place for testing purposes,
+# then run the release script again.
+rm -rf $FOLDER
+
+# copy everything except ignored files to the
+rsync -ad --exclude-from=tarball_ignore ./ $FOLDER
+
+# Replace version markers by the actual version number (from tags)
 for file in `find monocypher-$VERSION -type f`
 do
     sed -i "s/__git__/$VERSION/g" $file
 done
-tar -czf monocypher-$VERSION.tar.gz monocypher-$VERSION
-rm -rf monocypher-$VERSION
+
+# Remove the dist target from the makefile (no recursive releases!)
+sed '/dist:/,$d' makefile > $FOLDER/makefile
+
+# Remove contributor notes from the README
+sed '/Contributor notes/,$d' README.md > $FOLDER/README.md
+
+# Make the actual tarball
+tar -cvzf $TARBALL $FOLDER
+
+# Remove the temporary folder
+rm -rf $FOLDER
index 361426ec05e70664dea785b3630b2284ecf940e4..634630771efb7f4ba78fbb1cb21aa87f868bd8a2 100644 (file)
@@ -24,3 +24,11 @@ tests/formal-analysis
 monocypher-*
 lib*
 .git*
+release.sh
+tarball_ignore
+tests/gen*
+tests/vector_to_header.c
+tests/vectors
+tests/vectors/*
+tests/ed25519-donna*
+doc/man2html.sh