Skip to content

Commit

Permalink
Add release script for built assets
Browse files Browse the repository at this point in the history
  • Loading branch information
benhylau committed Apr 12, 2018
1 parent 67fe23b commit b473389
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated asset directory
output
publish

# GitBook
_book
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Building the Peer-to-Peer Internet

[![GitHub release](https://img.shields.io/github/release/qubyte/rubidium.svg)](https://github.com/tomeshnet/p2p-internet-workshop/releases)

**Workshop Series** _by Toronto Mesh_, [tomesh.net/peer-to-peer-internet](https://tomesh.net/peer-to-peer-internet/)

## Description
Expand Down Expand Up @@ -58,6 +60,14 @@ Participants will be expected to bring their own laptop.
- Engage students and equip them with necessary knowledge to continue involvement in local mesh community efforts
- Publish this as open-source syllabus that other communities can adopt to kick-start a mesh community

### Workshop Materials

Workshop materials such as lesson plans and worksheets are written as simple [Markdown](https://en.wikipedia.org/wiki/Markdown) files. Each presentation slide deck is created as a Markdown-based [GitBook](https://www.gitbook.com). All generated assets are published to [GitHub Releases for download](https://github.com/tomeshnet/p2p-internet-workshop/releases).

If you want to generate these assets yourself, simply run `./build` and you will find the generated assets in the `output` folder. The `./release` script is used to zip up the generated assets into archives convenient for publishing, which is the form you will find in the GitHub Releases.

When using the GitBook presentations at a workshop, it is most convenient to clone this repository, navigate to the appropriate presentation directory of the module, and serve the gitbook locally by running `gitbook serve`, then navigate to [localhost:4000](http://localhost:4000) from your browser to see the slides.

### Credits

- [@benhylau](https://github.com/benhylau)
Expand Down
9 changes: 9 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ basedir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
css="$basedir/pdf.css"
echo "Using CSS styles from $css"

# Generate general assets
for doc in general/*.md; do
if [ -f $doc ]; then
out="output/$(echo "$doc" | sed 's|/|-|g' | sed 's|.md|.pdf|')"
echo "Generating document from $doc to $out"
markdown-pdf "$doc" --out "$out" --cwd general --css-path pdf.css
fi
done

# Go through each module
for mod in module-*; do
# Generate lesson plans .pdf
Expand Down
16 changes: 16 additions & 0 deletions release
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Package assets for release
#

RELEASE_VERSION=0.1

./build

# Create directory for release assets ready to be published
rm -rf publish
mkdir publish

# Package assets in tar.gz and zip formats
tar --create --gzip -f "publish/workshop-materials-${RELEASE_VERSION}.tar.gz" -C output .
cd output; zip --recurse-paths "../publish/workshop-materials-${RELEASE_VERSION}.zip" .; cd ..

0 comments on commit b473389

Please sign in to comment.