-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the cross compiled binaries built by my local machine. added up…
…load release assets script. added scripts for building debian packages and support for cross-compilation.
- Loading branch information
Showing
10 changed files
with
278 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Author: Stefan Buck | ||
# License: MIT | ||
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | ||
# | ||
# | ||
# This script accepts the following parameters: | ||
# | ||
# * owner | ||
# * repo | ||
# * tag | ||
# * filename | ||
# * github_api_token | ||
# | ||
# Script to upload a release asset using the GitHub API v3. | ||
# | ||
# Example: | ||
# | ||
# upload-github-release-asset.sh github_api_token=TOKEN owner=stefanbuck repo=playground tag=v0.1.0 filename=./build.zip | ||
# | ||
|
||
# Check dependencies. | ||
set -e | ||
xargs=$(which gxargs || which xargs) | ||
|
||
# Validate settings. | ||
[ "$TRACE" ] && set -x | ||
|
||
CONFIG=$@ | ||
|
||
for line in $CONFIG; do | ||
eval "$line" | ||
done | ||
|
||
# Define variables. | ||
OWNER=yjdwbj | ||
REPO_NAME=gst-webrtc-camera | ||
GH_API="https://api.github.com" | ||
GH_REPO="$GH_API/repos/$OWNER/$REPO_NAME" | ||
GH_TAGS="$GH_REPO/releases/tags/$tag" | ||
AUTH="Authorization: token ${GITHUB_TOKEN}" | ||
WGET_ARGS="--content-disposition --auth-no-challenge --no-cookie" | ||
CURL_ARGS="-LJO#" | ||
|
||
if [[ "$tag" == 'LATEST' ]]; then | ||
GH_TAGS="$GH_REPO/releases/latest" | ||
fi | ||
|
||
# Validate token. | ||
curl -o /dev/null -sH "$AUTH" $GH_REPO || { echo "Error: Invalid repo, token or network issue!"; exit 1; } | ||
|
||
# Read asset tags. | ||
response=$(curl -sH "$AUTH" $GH_TAGS) | ||
|
||
# Get ID of the asset based on given filename. | ||
eval $(echo "$response" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=') | ||
[ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$response" | awk 'length($0)<100' >&2; exit 1; } | ||
|
||
# Upload asset | ||
echo "Uploading asset... " | ||
|
||
# Construct url | ||
GH_ASSET="https://uploads.github.com/repos/${OWNER}/${REPO_NAME}/releases/$id/assets?name=$(basename $filename)" | ||
|
||
curl "$GITHUB_OAUTH_BASIC" --data-binary @"$filename" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" $GH_ASSET |
Oops, something went wrong.