From 3988c2f9be9c41fd5dd47a2a48911411e90f8262 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 23 Jul 2022 13:44:55 -0400 Subject: [PATCH] Add a release script. --- .cvsignore | 1 + Telodendria.html | 14 +++++----- make.sh | 69 ++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 70 insertions(+), 14 deletions(-) diff --git a/.cvsignore b/.cvsignore index 378eac2..762ed61 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ build +.env diff --git a/Telodendria.html b/Telodendria.html index 51ff907..7688b29 100644 --- a/Telodendria.html +++ b/Telodendria.html @@ -250,13 +250,13 @@ file is just JSON, and it should be called

Project Status

Telodendria is a very ambitious project. There's a lot that needs -to happen yet before it is even remotely usable. At the moment, there's -nothing that even remotely resembles a Matrix homeserver here; we're still +to happen yet before it is usable. At the moment, there's nothing that +even remotely resembles a Matrix homeserver here; I'm still getting off the ground and building a foundation.

-Just because there's nothing here yet doesn't mean you should go away -though! We desparately need help, so you are more than welcome to help +But just because there's nothing here yet doesn't mean you should go away! +I could always use help, so you are more than welcome to help out if you want things to go quicker. Please see the Contributing section for details on how you can get involved. @@ -281,9 +281,10 @@ can get involved.

  • Combine library code files
  • Implement configuration file parsing using the hash map
  • Base64 encoding/decoding with padded/unpadded support
  • -
  • Write a release script
  • +
  • Write a release script
  • Implement a JSON library using the hash map and array
  • -
  • Figure out how to write unit tests for array/hashmap/etc
  • +
  • Figure out how to wWrite unit tests for array/hashmap/etc
  • +
  • Add license/documentation comments to all source files
  • Implement a simple HTTP server
  • Design the server architecture @@ -334,6 +335,7 @@ on my list for that:
  • Update Rationale section
  • Update Project description (no longer a CGI binary)
  • Update project code requirements (ANSI C, POSIX.1c)
  • +
  • Clean up dark mode colors (tables, background, code snippets
  • Rationale

    diff --git a/make.sh b/make.sh index ef0fd0d..73d4b41 100644 --- a/make.sh +++ b/make.sh @@ -1,15 +1,27 @@ #!/usr/bin/env sh -TELODENDRIA_VERSION="0.0.1" -CVS_TAG="Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')" +# +# Set variables +# +# This syntax may look odd, but as far as I can tell, it is POSIX, +# and it allows the values to be overridden by the environment, +# such that these serve more as sane defaults than hard requirements. +# -HEADERS="-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"" -INCLUDES="-Isrc/include" +: "${TELODENDRIA_VERSION:=0.0.0}" +: "${CVS_TAG:=Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')}" -CC="${CC:-cc}" -CFLAGS="-Wall -Werror -pedantic -std=c89 -O3 $HEADERS $INCLUDES" -LDFLAGS="-static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections" -PROG="telodendria" +: "${HEADERS:=-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" +: "${INCLUDES:=-Isrc/include}" + +: "${CC:=cc}" +: "${CFLAGS:=-Wall -Werror -pedantic -std=c89 -O3 $HEADERS $INCLUDES}" +: "${LDFLAGS:=-static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections}" +: "${PROG:=telodendria}" + +if [ -f "$(pwd)/.env" ]; then + . "$(pwd)/.env" +fi mod_time() { if [ -n "$1" ] && [ -f "$1" ]; then @@ -65,6 +77,46 @@ recipe_test() { echo "Unit tests are not implemented yet." } +recipe_site() { + if [ -z "$TELODENDRIA_PUB" ]; then + echo "No public root directory specified." + echo "Set TELODENDRIA_PUB." + exit 1 + fi + + cp "Telodendria.css" "$TELODENDRIA_PUB/" + cp "Telodendria.html" "$TELODENDRIA_PUB/index.html" + cp "release/telodendria-signify.pub" "$TELODENDRIA_PUB/" +} + +recipe_release() { + if [ -z "$TELODENDRIA_PUB" ]; then + echo "No public root directory specified." + echo "Set TELODENDRIA_PUB." + exit 1 + fi + + if [ -z "$TELODENDRIA_SIGNIFY_SECRET" ]; then + echo "No signify secret key specified." + echo "Set TELODENDRIA_SIGNIFY_SECRET." + exit 1 + fi + + mkdir -p "$TELODENDRIA_PUB/pub/v$TELODENDRIA_VERSION" + cd "$TELODENDRIA_PUB/pub/v$TELODENDRIA_VERSION" + + cvs export "-r$CVS_TAG" "Telodendria" + mv "Telodendria" "Telodendria-v$TELODENDRIA_VERSION" + tar -czf "Telodendria-v$TELODENDRIA_VERSION.tar.gz" \ + "Telodendria-v$TELODENDRIA_VERSION" + rm -r "Telodendria-v$TELODENDRIA_VERSION" + sha256 "Telodendria-v$TELODENDRIA_VERSION.tar.gz" \ + > "Telodendria-v$TELODENDRIA_VERSION.tar.gz.sha256" + signify -S -s "$TELODENDRIA_SIGNIFY_SECRET" \ + -m "Telodendria-v$TELODENDRIA_VERSION.tar.gz" \ + -x "Telodendria-v$TELODENDRIA_VERSION.tar.gz.sig" +} + for recipe in $@; do recipe_$recipe done @@ -72,3 +124,4 @@ done if [ -z "$1" ]; then recipe_build fi +