CodeCommitsIssuesPull requestsActionsInsightsSecurity
b6d5b5b266717b796f8cd5b25b4d2ecd6dad95a0

Branches

Tags

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

Clone

HTTPS

Download ZIP

utils/release.sh

49lines · modepreview

set -e

# Install jq with brew install jq

RELEASE=$1

git tag $RELEASE
git push origin master --tags

UPLOAD_URL=$(curl -X POST "https://api.github.com/repos/EagerIO/Stout/releases" \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: token $GITHUB_AUTH" \
  -H "Content-Type: application/json" \
  -d "
{
  \"tag_name\": \"$RELEASE\"
}" | jq -r '.upload_url' | cut -d { -f 1)

mkdir -p debian

echo "
Package: stout
Source: stout
Version: $RELEASE
Architecture: all
Maintainer: Zack Bloom <zack@eager.io>
Description: The reliable static website deploy tool
" > `dirname $0`/../control

`dirname $0`/xc.sh

upload () {
  local archive=$1
  local filename=$(basename "$archive")
  local extension="${filename##*.}"

  if [ "$extension" == "md" ]; then
    return
  fi

  curl -X POST "$UPLOAD_URL?name=$filename" \
    -H "Content-Type: application/octet-stream" \
    -H "Authorization: token $GITHUB_AUTH" \
    --data-binary @$archive
}

for f in builds/snapshot/*; do upload "$f" & done

wait