Skip to content

Instantly share code, notes, and snippets.

@tierra
Created October 25, 2015 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tierra/39c769c4b087ab7030df to your computer and use it in GitHub Desktop.
Save tierra/39c769c4b087ab7030df to your computer and use it in GitHub Desktop.
Script used to create and upload existing wxWidgets releases to GitHub
#!/bin/bash
# You must generate a personal access token with public_repo
# permission, and configure that token using the following:
# export GITHUB_TOKEN="..."
GITHUB_USER="wxWidgets"
GITHUB_REPO="wxWidgets"
for directory in v*/; do
tag=$(basename $directory)
version=$(echo $tag | sed 's/^v//')
echo "Creating release for $version ($tag).";
# For testing purposes:
#github-release delete --tag $tag
if [ -f $tag/readme.txt ]; then
echo "Using readme.txt for description."
github-release release --tag $tag --name $version --description "$(< $tag/readme.txt)"
else
echo "Using README.md for description."
github-release release --tag $tag --name $version --description "$(< $tag/README.md)"
fi
for file in $tag/*; do
echo "Uploading $file"
github-release upload --tag $tag --name "$(basename $file)" --file $file
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment