-
-
Save pombredanne/1058bc3878347a416ccd7bd3876009dc to your computer and use it in GitHub Desktop.
Upload release assets to Github from the command line
This file contains hidden or 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
"""Upload release assets to a GitHub release | |
First create a release on Github, then: | |
python upload_release_assets.py 1.2.0 my_data.tgz | |
""" | |
import sys | |
REPOSITORY="your_organization/your_repo" | |
with open("GITHUB_TOKEN") as f: | |
TOKEN=f.read().strip() | |
from github import Github | |
g = Github(TOKEN) | |
repo = g.get_repo(REPOSITORY) | |
release = repo.get_release(sys.argv[1]) | |
release.upload_asset(sys.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment