1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
esp8266/package/upload_release.py
Earle F. Philhower, III 9afb084159
Clean up minor warnings from LGTM.com (#7500)
* Clean up minor warnings from LGTM.com

LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.

Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list

No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.

* Back out HTML changes and rerun boards.txt.py
2020-08-03 19:19:04 -07:00

26 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python3
from github import Github
import argparse
parser = argparse.ArgumentParser(description='Upload a set of files to a new draft release')
parser.add_argument('--user', help="Github username", type=str, required=True)
parser.add_argument('--token', help="Github Personal Access Token (PAT)", type=str, required=True)
parser.add_argument('--repo', help="Repository", type=str, required=True)
parser.add_argument('--tag', help="Release tag", type=str, required=True)
parser.add_argument('--name', help="Release name", type=str, required=True)
parser.add_argument('--msg', help="Release message", type=str, required=True)
parser.add_argument('files', nargs=argparse.REMAINDER)
args = parser.parse_args()
if len(args.files) == 0:
print("ERROR: No files specified")
quit()
gh = Github(login_or_token=args.token)
repo = gh.get_repo(str(args.repo))
release = repo.create_git_release(args.tag, args.name, args.msg, draft=True)
for fn in args.files:
print("Uploading file: " + fn)
release.upload_asset(fn)