cloudflare/Stout
Publicmirrored fromhttps://github.com/cloudflare/Stout
utils/release.sh
49lines · modecode
| 1 | set -e |
| 2 | |
| 3 | # Install jq with brew install jq |
| 4 | |
| 5 | RELEASE=$1 |
| 6 | |
| 7 | git tag $RELEASE |
| 8 | git push origin master --tags |
| 9 | |
| 10 | UPLOAD_URL=$(curl -X POST "https://api.github.com/repos/EagerIO/Stout/releases" \ |
| 11 | -H "Accept: application/vnd.github.v3+json" \ |
| 12 | -H "Authorization: token $GITHUB_AUTH" \ |
| 13 | -H "Content-Type: application/json" \ |
| 14 | -d " |
| 15 | { |
| 16 | \"tag_name\": \"$RELEASE\" |
| 17 | }" | jq -r '.upload_url' | cut -d { -f 1) |
| 18 | |
| 19 | mkdir -p debian |
| 20 | |
| 21 | echo " |
| 22 | Package: stout |
| 23 | Source: stout |
| 24 | Version: $RELEASE |
| 25 | Architecture: all |
| 26 | Maintainer: Zack Bloom <zack@eager.io> |
| 27 | Description: The reliable static website deploy tool |
| 28 | " > `dirname $0`/../control |
| 29 | |
| 30 | `dirname $0`/xc.sh |
| 31 | |
| 32 | upload () { |
| 33 | local archive=$1 |
| 34 | local filename=$(basename "$archive") |
| 35 | local extension="${filename##*.}" |
| 36 | |
| 37 | if [ "$extension" == "md" ]; then |
| 38 | return |
| 39 | fi |
| 40 | |
| 41 | curl -X POST "$UPLOAD_URL?name=$filename" \ |
| 42 | -H "Content-Type: application/octet-stream" \ |
| 43 | -H "Authorization: token $GITHUB_AUTH" \ |
| 44 | --data-binary @$archive |
| 45 | } |
| 46 | |
| 47 | for f in builds/snapshot/*; do upload "$f" & done |
| 48 | |
| 49 | wait |