Skip to content

Commit 2560594

Browse files
committed
Add Travis CI publish on tag
1 parent 4e9179b commit 2560594

File tree

5 files changed

+40
-27
lines changed

5 files changed

+40
-27
lines changed

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
install: "./install-dependencies.sh"
2+
3+
script: "./build.sh"
4+
5+
before_deploy: "./package $TRAVIS_TAG"
6+
7+
deploy:
8+
provider: releases
9+
api_key:
10+
secure: VnXRjvEsJKZJ0mto3ZMOFccE8QzuRvqyxm6juM05g3Z9GuC1E3wuQI+3N0qSinkxUpzbjfSWhBSeApN7cKPKYJTBehDA6euQyTTY12LbZliSNkwmS2YBfPjJqll4/kCLMzYvaQwVbPijhIUYOCUI/6x28OGJUSohdH3RplJ68LGsIzbTkZ/j17u6iKDIqzmazngTMriWaNC5eKGTSYLXbTibJxJtYOTi8OcsvuAd5KGQpU06MJFxB5ARCK1WATwHIeLWsIKux670vJkH2duYRxexirRcL5C42PwqqihalW4JC7nEilC2IMq2MUGlTeO2ph8UEKZ4O/w0BZTOvb1SJ2YJlfF1lm1Hu/LiEw1pDzkWA1DcneyvAezCjJ9cEjqT2nRPqBY3e/OSjpH7pFMr0o8xaX0N3MRzvZ7Lu/7Ds/DMZeavqE+UVLLvb3BKqboJYwl3T0tN452zUkGpiP+MNW+ZECKbd5FGF9kpSLfGG4rT7FFtVAvPkqzwKuX+1QCFOXemrrtfcL6H7uDIJzlzz7qxccIo5rGfeb/XXNeAVc0+L3S9DNHN+L6u0T5kOMiwO6sLabjBrqhiA6yowSMlSV1oKWDeXkzYZBC+05bA/cRpC6W+49+I1zBze9qe4YMZ1ztDtlV/E5LfbfisrWSjQQRhyvA7FxVsXLw/Q5st17Q=
11+
file:
12+
- "publish/workshop-materials-$TRAVIS_TAG.tar.gz"
13+
- "publish/workshop-materials-$TRAVIS_TAG.zip"
14+
skip_cleanup: true
15+
on:
16+
repo: tomeshnet/p2p-internet-workshop
17+
tags: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Participants will be expected to bring their own laptop.
5555

5656
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 Pages individually](https://github.com/tomeshnet/p2p-internet-workshop/tree/gh-pages) and [GitHub Releases as an archive](https://github.com/tomeshnet/p2p-internet-workshop/releases) for download.
5757

58-
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 download, which is the form you will find in the GitHub Releases.
58+
If you want to generate these assets yourself, simply run `./install-dependencies.sh` and `./build.sh` and you will find the generated assets in the `output` folder. The `./package.sh` script is used to zip up the generated assets into archives convenient for download, which is the form you will find in the GitHub Releases.
5959

6060
When using the GitBook presentations at a workshop, you can either:
6161

build renamed to build.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# Check for required tools
4-
echo "Checking for markdown-pdf node module"
5-
npm -g list markdown-pdf
6-
S=$?
7-
if [ $S -ne 0 ]; then
8-
echo "markdown-pdf is missing, install by running:"
9-
echo " npm install -g markdown-pdf"
10-
return $S
11-
fi
12-
13-
echo "Checking for gitbook-cli node module"
14-
npm -g list gitbook-cli
15-
S=$?
16-
if [ $S -ne 0 ]; then
17-
echo "gitbook-cli is missing, install by running:"
18-
echo " npm install -g gitbook-cli"
19-
return $S
20-
fi
21-
223
# Delete generated assets
234
rm -rf output
245
mkdir output

install-dependencies.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# Check for required tools
4+
echo "Checking for markdown-pdf node module"
5+
npm -g list markdown-pdf
6+
S=$?
7+
if [ $S -ne 0 ]; then
8+
echo "markdown-pdf is missing, install by running:"
9+
echo " npm install -g markdown-pdf"
10+
return $S
11+
fi
12+
13+
echo "Checking for gitbook-cli node module"
14+
npm -g list gitbook-cli
15+
S=$?
16+
if [ $S -ne 0 ]; then
17+
echo "gitbook-cli is missing, install by running:"
18+
echo " npm install -g gitbook-cli"
19+
return $S
20+
fi

release renamed to package.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
#!/usr/bin/env bash
2-
#
3-
# Package assets for release
4-
#
52

6-
RELEASE_VERSION=0.2
7-
8-
./build
3+
RELEASE_VERSION=$1
94

105
# Create directory for release assets ready to be published
116
rm -rf publish
127
mkdir publish
138

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

0 commit comments

Comments
 (0)