CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

utils/release.sh

49lines · modecode

1set -e
2
3# Install jq with brew install jq
4
5RELEASE=$1
6
7git tag $RELEASE
8git push origin master --tags
9
10UPLOAD_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
19mkdir -p debian
20
21echo "
22Package: stout
23Source: stout
24Version: $RELEASE
25Architecture: all
26Maintainer: Zack Bloom <zack@eager.io>
27Description: The reliable static website deploy tool
28" > `dirname $0`/../control
29
30`dirname $0`/xc.sh
31
32upload () {
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
47for f in builds/snapshot/*; do upload "$f" & done
48
49wait